EditorManager: Introduce a DoNotRaise EditorManager::OpenEditorFlag

In some situations it might be beneficial to set up the editor
as usual but do not raise the application window.

This is opt-in, existing behavior is not affected.

Task-number: QTCREATORBUG-12769
Change-Id: If9826717bba06283187d10073c02a748b638c3f8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2020-11-20 13:39:14 +01:00
parent 8d67dd57e8
commit c2090d101b
2 changed files with 4 additions and 2 deletions

View File

@@ -1543,7 +1543,8 @@ IEditor *EditorManagerPrivate::activateEditor(EditorView *view, IEditor *editor,
ModeManager::activateMode(Constants::MODE_EDIT);
}
editor->widget()->setFocus();
ICore::raiseWindow(editor->widget());
if (!(flags & EditorManager::DoNotRaise))
ICore::raiseWindow(editor->widget());
}
}
} else if (!(flags & EditorManager::DoNotMakeVisible)) {

View File

@@ -81,7 +81,8 @@ public:
OpenInOtherSplit = 16,
DoNotSwitchToDesignMode = 32,
DoNotSwitchToEditMode = 64,
SwitchSplitIfAlreadyVisible = 128
SwitchSplitIfAlreadyVisible = 128,
DoNotRaise = 256
};
Q_DECLARE_FLAGS(OpenEditorFlags, OpenEditorFlag)