From e7a0bf680f3d805b190b89bfeb1f1f8a4c3ec982 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Sat, 29 Jul 2017 23:08:01 +0200 Subject: Add basic "Jump to related" which jumps to request/response respectivly --- src/gui_qt.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/gui_qt.cc') diff --git a/src/gui_qt.cc b/src/gui_qt.cc index 94a00cd..d4bc3d8 100644 --- a/src/gui_qt.cc +++ b/src/gui_qt.cc @@ -279,7 +279,8 @@ public: return flags; } - QModelIndex index(int row, int column, const QModelIndex& parent) const override { + QModelIndex index(int row, int column, + const QModelIndex& parent = QModelIndex()) const override { if (!parent.isValid() && row >= 0 && static_cast(row) < model_->rows() && column >= 0 && static_cast(column) < model_->columns()) { @@ -450,6 +451,12 @@ public: return listmodel_ ? listmodel_->model() : nullptr; } + void select_row(size_t row) override { + if (!listmodel_ || !top_) return; + QTreeView* treeview = static_cast(top_); + treeview->setCurrentIndex(listmodel_->index(row, 0)); + } + void set_package(std::unique_ptr&& text) override { if (text) { package_ = "" -- cgit v1.2.3-70-g09d2