OSDN Git Service

QmlDesigner.navigator: scroll to selected item
authorThomas Hartmann <Thomas.Hartmann@nokia.com>
Thu, 7 Apr 2011 14:38:44 +0000 (16:38 +0200)
committerThomas Hartmann <Thomas.Hartmann@nokia.com>
Thu, 7 Apr 2011 14:45:34 +0000 (16:45 +0200)
Reviewed-by: Marco Bubke
src/plugins/qmldesigner/components/navigator/navigatorview.cpp

index 93a0439..4f32274 100644 (file)
@@ -294,6 +294,9 @@ void NavigatorView::updateItemSelection()
     treeWidget()->selectionModel()->select(itemSelection, QItemSelectionModel::ClearAndSelect);
     blockSelectionChangedSignal(blocked);
 
+    if (!selectedModelNodes().isEmpty())
+        treeWidget()->scrollTo(m_treeModel->indexForNode(selectedModelNodes().first()));
+
     // make sure selected nodes a visible
     foreach(const QModelIndex &selectedIndex, itemSelection.indexes()) {
         if (selectedIndex.column() == 0)