diff options
| author | Joel Klinghed <the_jk@yahoo.com> | 2017-07-29 23:08:01 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@yahoo.com> | 2017-07-29 23:08:01 +0200 |
| commit | e7a0bf680f3d805b190b89bfeb1f1f8a4c3ec982 (patch) | |
| tree | f0799a14f1a697850eb7c05edd484ffdb4038f08 /src/gui_qt.cc | |
| parent | 53c474283e4e378185d86f57384bb5d8ae933df4 (diff) | |
Add basic "Jump to related" which jumps to request/response respectivly
Diffstat (limited to 'src/gui_qt.cc')
| -rw-r--r-- | src/gui_qt.cc | 9 |
1 files changed, 8 insertions, 1 deletions
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<size_t>(row) < model_->rows() && column >= 0 && static_cast<size_t>(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<QTreeView*>(top_); + treeview->setCurrentIndex(listmodel_->index(row, 0)); + } + void set_package(std::unique_ptr<AttributedText>&& text) override { if (text) { package_ = "<span style=\"font-family: monospace;\">" |
