Core: Add a static IContext::attach() function

... to simplify the user code.

Some, but not all, potential beneficiaries are adapted.

Change-Id: Ia7d514a0114a4f99f8ee745523435f5b990bd095
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2024-07-03 14:55:42 +02:00
parent d58780213d
commit 2c40765e86
28 changed files with 44 additions and 115 deletions

View File

@@ -34,10 +34,7 @@ WindowSupport::WindowSupport(QWidget *window, const Context &context, const Cont
{
m_window->installEventFilter(this);
m_contextObject = new IContext(this);
m_contextObject->setWidget(window);
m_contextObject->setContext(context);
ICore::addContextObject(m_contextObject);
IContext::attach(window, context);
const Context ac = actionContext.isEmpty() ? context : actionContext;
if (useMacShortcuts) {