summaryrefslogtreecommitdiff
path: root/src/plugins/classview
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-03-13 11:25:38 +0100
committerEike Ziller <eike.ziller@qt.io>2018-03-13 11:25:38 +0100
commit0b10ecc718accd8c4d472ba8f3ed5ea6f1856e51 (patch)
tree67f63d2b4aa20195910728659cd3c0ba2cb580eb /src/plugins/classview
parentf1985df55dfa81f184c9d29df6cfbb353bf77ffc (diff)
parent0bcc983cdbb74baebccfdb09f7d2ffb22ebf950d (diff)
downloadqt-creator-0b10ecc718accd8c4d472ba8f3ed5ea6f1856e51.tar.gz
Merge remote-tracking branch 'origin/4.6'
Conflicts: src/plugins/cmakeprojectmanager/cmakeproject.h src/plugins/debugger/debuggerplugin.cpp src/plugins/ios/iosrunfactories.cpp src/plugins/nim/project/nimproject.h src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp src/plugins/qmakeandroidsupport/qmakeandroidrunfactories.cpp src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp src/plugins/qmlprojectmanager/qmlproject.h src/plugins/qnx/qnxrunconfigurationfactory.cpp src/plugins/qtsupport/exampleslistmodel.cpp src/plugins/winrt/winrtrunfactories.cpp Change-Id: Ib029fdbaa65270426332f5edd6e90264be5fb539
Diffstat (limited to 'src/plugins/classview')
-rw-r--r--src/plugins/classview/classviewnavigationwidget.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/classview/classviewnavigationwidget.cpp b/src/plugins/classview/classviewnavigationwidget.cpp
index 5ce0d24e73..58cab5a6d8 100644
--- a/src/plugins/classview/classviewnavigationwidget.cpp
+++ b/src/plugins/classview/classviewnavigationwidget.cpp
@@ -105,7 +105,7 @@ NavigationWidget::NavigationWidget(QWidget *parent) :
verticalLayout->addWidget(Core::ItemViewFind::createSearchableWrapper(
treeView, Core::ItemViewFind::DarkColored,
Core::ItemViewFind::FetchMoreWhileSearching));
-
+ setFocusProxy(treeView);
// tree model
treeModel = new TreeItemModel(this);
treeView->setModel(treeModel);
@@ -282,10 +282,12 @@ void NavigationWidget::onDataUpdate(QSharedPointer<QStandardItem> result)
// expand top level projects
QModelIndex sessionIndex;
-
- for (int i = 0; i < treeModel->rowCount(sessionIndex); ++i)
+ const int toplevelCount = treeModel->rowCount(sessionIndex);
+ for (int i = 0; i < toplevelCount; ++i)
treeView->expand(treeModel->index(i, 0, sessionIndex));
+ if (!treeView->currentIndex().isValid() && toplevelCount > 0)
+ treeView->setCurrentIndex(treeModel->index(0, 0, sessionIndex));
if (debug)
qDebug() << "Class View:" << QDateTime::currentDateTime().toString()
<< "TreeView is updated in" << timer.elapsed() << "msecs";