From b83c829e21f503f2c064afdf2aa6a9f4f1c6ed22 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 12 Jan 2021 10:55:28 +0100 Subject: [PATCH] Fix project tree's "synchronize with editor" When for example closing all editors, the selection in the project tree is removed, but after re-opening the previously selected file, the selection was still missing. Qt item views differentiate between "current" item and "selection". The code uses the "current" item for tracking, but when clearing the selection in the project tree, the code did not "clear" the "current" item. Change-Id: I182c7b78bf8dcc51af71e860ac620310d472b7b5 Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/projecttreewidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 353d50716cc..7e3924fddb1 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -512,6 +512,7 @@ void ProjectTreeWidget::setCurrentItem(Node *node) } } else { m_view->clearSelection(); + m_view->setCurrentIndex({}); } }