From 32084b4f5dfbfa2f653f55cfa514317c4b065b1e Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Mon, 11 Feb 2019 15:09:10 +0100 Subject: Converted program listing to be QTableView based. Signed-off-by: Pavel Pisa --- qtmips_gui/memorytableview.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'qtmips_gui/memorytableview.cpp') 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(model()); int row; if (m == nullptr) -- cgit v1.2.3