aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/programmodel.h
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-03-14 21:43:34 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-03-14 21:43:34 +0100
commit36747de2c73d3c11e30abd7b371cc5a5cf91a331 (patch)
treeb00c7e3acc62bd55bb51f66f0a0e627a3e1a510a /qtmips_gui/programmodel.h
parent0765d399e56aa387674c3591ec4886cc37d8fccd (diff)
downloadqtmips-36747de2c73d3c11e30abd7b371cc5a5cf91a331.tar.gz
qtmips-36747de2c73d3c11e30abd7b371cc5a5cf91a331.tar.bz2
qtmips-36747de2c73d3c11e30abd7b371cc5a5cf91a331.zip
Fix nested calls of setCurrentIndex which caused breakage.
ProgramTableView::focus_address() calls QAbstractItemView::setCurrentIndex(). verticalScrollBar() value is updated as result of current row change. This emits signal valueChanged which is connected to ProgramTableView::adjust_scroll_pos(). It checks if the limit of range covered by actual model and row to address offset is reached. If the top or bottom 1/8 of range is reached then model needs to be adjusted to cover continuation area. Model shift requires update of the current row to stay on the same address even that row 0 address offset is changed. This model shifting is required because range of scroll is only signed integer and QTableView is even more limited in row count to work reliably. Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui/programmodel.h')
-rw-r--r--qtmips_gui/programmodel.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/qtmips_gui/programmodel.h b/qtmips_gui/programmodel.h
index 9beecef..f5159af 100644
--- a/qtmips_gui/programmodel.h
+++ b/qtmips_gui/programmodel.h
@@ -53,7 +53,7 @@ public:
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
Qt::ItemFlags flags(const QModelIndex &index) const;
bool setData(const QModelIndex & index, const QVariant & value, int role);
- bool adjustRowAndOffset(int &row, int optimal_row, std::uint32_t address);
+ bool adjustRowAndOffset(int &row, std::uint32_t address);
void update_all();
inline const QFont *getFont() const {