diff options
author | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-02-10 01:16:12 +0100 |
---|---|---|
committer | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-02-10 01:16:12 +0100 |
commit | 2fdc9e0e64c234832e13735a9e6972a699ed9bed (patch) | |
tree | 18738169a085b72b45a5303a95c7baf346178a32 /qtmips_gui/memorymodel.h | |
parent | fa867875a15faf61ceef4bbc7b6e4f281fa91954 (diff) | |
download | qtmips-2fdc9e0e64c234832e13735a9e6972a699ed9bed.tar.gz qtmips-2fdc9e0e64c234832e13735a9e6972a699ed9bed.tar.bz2 qtmips-2fdc9e0e64c234832e13735a9e6972a699ed9bed.zip |
Next steps to implement QTableView based memory view.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui/memorymodel.h')
-rw-r--r-- | qtmips_gui/memorymodel.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/qtmips_gui/memorymodel.h b/qtmips_gui/memorymodel.h index 8a01531..bbe51c5 100644 --- a/qtmips_gui/memorymodel.h +++ b/qtmips_gui/memorymodel.h @@ -37,6 +37,8 @@ #define MEMORYMODEL_H #include <QAbstractTableModel> +#include <QFont> +#include "qtmipsmachine.h" class MemoryModel : public QAbstractTableModel { @@ -55,7 +57,17 @@ public: int columnCount(const QModelIndex &parent = QModelIndex()) const override; QVariant headerData(int section, Qt::Orientation orientation, int role) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; -private: + + void setCellsPerRow(unsigned int cells); + + inline unsigned int cellsPerRow() { + return cells_per_row; + } + + inline const QFont *getFont() const { + return &data_font; + } + inline unsigned int cellSizeBytes() const { switch (cell_size) { case CELLSIZE_BYTE: @@ -67,10 +79,16 @@ private: } return 0; } +public slots: + void setup(machine::QtMipsMachine *machine); + void set_cell_size(int index); +private: enum MemoryCellSize cell_size; unsigned int cells_per_row; std::uint32_t index0_offset; + QFont data_font; + machine::QtMipsMachine *machine; }; |