forked from qt-creator/qt-creator
Project Tree: Fix focus issue
Some godawful global focus state was set too late, resulting in weird behavior after an action in the context menu was activated via the keyboard. (Namely: If you did that *once*, the "Add New File..." entry would *forever* be disabled in all subsequent context menus, regardless of project, session etc.) Fixes: QTCREATORBUG-22850 Change-Id: I0afed61b65ac5064cb6a229c9bfa45445a3a6c34 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -352,8 +352,8 @@ void ProjectTree::showContextMenu(ProjectTreeWidget *focus, const QPoint &global
|
||||
}
|
||||
|
||||
if (contextMenu && contextMenu->actions().count() > 0) {
|
||||
contextMenu->popup(globalPos);
|
||||
s_instance->m_focusForContextMenu = focus;
|
||||
contextMenu->popup(globalPos);
|
||||
connect(contextMenu, &QMenu::aboutToHide,
|
||||
s_instance, &ProjectTree::hideContextMenu,
|
||||
Qt::ConnectionType(Qt::UniqueConnection | Qt::QueuedConnection));
|
||||
|
Reference in New Issue
Block a user