diff options
author | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-02-11 15:09:10 +0100 |
---|---|---|
committer | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-02-11 15:09:10 +0100 |
commit | 32084b4f5dfbfa2f653f55cfa514317c4b065b1e (patch) | |
tree | a5a30b51a71aa662b5bc34e96d6f6c8b6ee90338 /qtmips_gui/memorytableview.cpp | |
parent | 20a381e4ba81777b2ad2d9cc988b990ca2ed0f55 (diff) | |
download | qtmips-32084b4f5dfbfa2f653f55cfa514317c4b065b1e.tar.gz qtmips-32084b4f5dfbfa2f653f55cfa514317c4b065b1e.tar.bz2 qtmips-32084b4f5dfbfa2f653f55cfa514317c4b065b1e.zip |
Converted program listing to be QTableView based.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui/memorytableview.cpp')
-rw-r--r-- | qtmips_gui/memorytableview.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/qtmips_gui/memorytableview.cpp b/qtmips_gui/memorytableview.cpp index 9b5d0ba..18e1bb1 100644 --- a/qtmips_gui/memorytableview.cpp +++ b/qtmips_gui/memorytableview.cpp @@ -62,21 +62,21 @@ void MemoryTableView::adjustColumnCount() { QString t = ""; t.fill(QChar('0'), m->cellSizeBytes() * 2); /* t + = " C"; */ - int width1 = fm.width(t) + 1; + int width1 = fm.width(t); if (width1 < fm.width("+99")) width1 = fm.width("+99"); horizontalHeader()->setSectionResizeMode(1, QHeaderView::Fixed); horizontalHeader()->resizeSection(1, width1); - int w = verticalHeader()->width() + 8; + int w = verticalHeader()->width() + 4; unsigned int cells; width0 = columnWidth(0); width1 = columnWidth(1); w = width() - w - width0; - if (w < width1) { + if (w < width1 + 2) { cells = 1; } else { - cells = w / width1; + cells = w / (width1 + 2); } if (cells != m->cellsPerRow()) { m->setCellsPerRow(cells); @@ -167,7 +167,7 @@ void MemoryTableView::resizeEvent(QResizeEvent *event) { } } -void MemoryTableView:: go_to_address(std::int32_t address) { +void MemoryTableView:: go_to_address(std::uint32_t address) { MemoryModel *m = dynamic_cast<MemoryModel*>(model()); int row; if (m == nullptr) |