summaryrefslogtreecommitdiff
path: root/src/plugins/todo
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2013-12-03 11:01:46 +0200
committerOrgad Shaneh <orgads@gmail.com>2013-12-12 10:12:14 +0100
commit6f6e09211c23ec299607c527c0990f4fb1c31165 (patch)
tree1a497c1c2aaca2bc5e1410f1aea13e82c8ed488f /src/plugins/todo
parent25389fcc25e2ec54917bb0b0e52894e4480fb003 (diff)
downloadqt-creator-6f6e09211c23ec299607c527c0990f4fb1c31165.tar.gz
Todo: Fix goToNext/Prev behavior
* Select whole row * Jump to related location Change-Id: I5b63345eea9a0d51949f206c67fb6ae52f09bb27 Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src/plugins/todo')
-rwxr-xr-xsrc/plugins/todo/todooutputpane.cpp10
-rw-r--r--src/plugins/todo/todooutputtreeview.cpp1
2 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/todo/todooutputpane.cpp b/src/plugins/todo/todooutputpane.cpp
index 6efa68fafd..da5bb925e1 100755
--- a/src/plugins/todo/todooutputpane.cpp
+++ b/src/plugins/todo/todooutputpane.cpp
@@ -123,12 +123,18 @@ bool TodoOutputPane::canPrevious() const
void TodoOutputPane::goToNext()
{
- m_todoTreeView->selectionModel()->select(nextModelIndex(), QItemSelectionModel::SelectCurrent);
+ const QModelIndex nextIndex = nextModelIndex();
+ m_todoTreeView->selectionModel()->setCurrentIndex(nextIndex, QItemSelectionModel::SelectCurrent
+ | QItemSelectionModel::Rows);
+ todoTreeViewClicked(nextIndex);
}
void TodoOutputPane::goToPrev()
{
- m_todoTreeView->selectionModel()->select(previousModelIndex(), QItemSelectionModel::SelectCurrent);
+ const QModelIndex prevIndex = previousModelIndex();
+ m_todoTreeView->selectionModel()->setCurrentIndex(prevIndex, QItemSelectionModel::SelectCurrent
+ | QItemSelectionModel::Rows);
+ todoTreeViewClicked(prevIndex);
}
void TodoOutputPane::setScanningScope(ScanningScope scanningScope)
diff --git a/src/plugins/todo/todooutputtreeview.cpp b/src/plugins/todo/todooutputtreeview.cpp
index 6c211f4613..1475284b3d 100644
--- a/src/plugins/todo/todooutputtreeview.cpp
+++ b/src/plugins/todo/todooutputtreeview.cpp
@@ -48,6 +48,7 @@ TodoOutputTreeView::TodoOutputTreeView(QWidget *parent) :
setFrameStyle(QFrame::NoFrame);
setSortingEnabled(true);
setAttribute(Qt::WA_MacShowFocusRect, false);
+ setSelectionBehavior(QTreeView::SelectRows);
header()->setResizeMode(QHeaderView::Interactive);
header()->setStretchLastSection(true);