EditorManager: Avoid warnings about already registered actions

When opening new editor windows, we want the _window_ to have the
EditorManager context as well as the individual window context, but the
window _actions_ (close, etc) may only be registered for the individual
window context.

Add the corresponding option to ICore::registerWindow et al.

Change-Id: I67d0a6b386603e0047a77dfb357c207e7ffe99e6
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Eike Ziller
2024-02-16 16:00:12 +01:00
parent 04d7f63186
commit 70f7e275e2
5 changed files with 20 additions and 14 deletions

View File

@@ -1011,14 +1011,15 @@ void ICore::removeAdditionalContext(const Context &context)
Registers a \a window with the specified \a context. Registered windows are
shown in the \uicontrol Window menu and get registered for the various
window related actions, like the minimize, zoom, fullscreen and close
actions.
actions. The context for the actions is \a context by default, but can be
overridden with \a actionContext.
Whenever the application focus is in \a window, its \a context is made
active.
*/
void ICore::registerWindow(QWidget *window, const Context &context)
void ICore::registerWindow(QWidget *window, const Context &context, const Context &actionContext)
{
new WindowSupport(window, context); // deletes itself when widget is destroyed
new WindowSupport(window, context, actionContext); // deletes itself when widget is destroyed
}
/*!