aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/programtableview.cpp
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-11 17:45:47 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-11 17:45:47 +0100
commit10f4d52221438f0d5ce7cc72c5b6c1f6720ef5c6 (patch)
tree2bf2cf63384a5d83d29ccbd036ea8ca30a84918e /qtmips_gui/programtableview.cpp
parent745a2aff8602a48b723a8d2ebf54b0e92cd17b30 (diff)
downloadqtmips-10f4d52221438f0d5ce7cc72c5b6c1f6720ef5c6.tar.gz
qtmips-10f4d52221438f0d5ce7cc72c5b6c1f6720ef5c6.tar.bz2
qtmips-10f4d52221438f0d5ce7cc72c5b6c1f6720ef5c6.zip
Extend program view to support selected stage followup.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui/programtableview.cpp')
-rw-r--r--qtmips_gui/programtableview.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/qtmips_gui/programtableview.cpp b/qtmips_gui/programtableview.cpp
index 34a119a..005b518 100644
--- a/qtmips_gui/programtableview.cpp
+++ b/qtmips_gui/programtableview.cpp
@@ -153,3 +153,15 @@ void ProgramTableView:: go_to_address(std::uint32_t address) {
addr0_save_change(address);
emit m->update_all();
}
+
+void ProgramTableView::focus_address(std::uint32_t address) {
+ int row;
+ ProgramModel *m = dynamic_cast<ProgramModel*>(model());
+ if (m == nullptr)
+ return;
+ if (!m->get_row_for_address(row, address))
+ go_to_address(address);
+ if (!m->get_row_for_address(row, address))
+ return;
+ setCurrentIndex(m->index(row, 3));
+}