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

@@ -66,14 +66,10 @@ EditMode::EditMode() :
this, &EditMode::grabEditorManager);
m_splitter->setFocusProxy(editorPlaceHolder);
auto modeContextObject = new IContext(this);
modeContextObject->setContext(Context(Constants::C_EDITORMANAGER));
modeContextObject->setWidget(m_splitter);
ICore::addContextObject(modeContextObject);
IContext::attach(m_splitter, Context(Constants::C_EDITORMANAGER));
setWidget(m_splitter);
setContext(Context(Constants::C_EDIT_MODE,
Constants::C_NAVIGATION_PANE));
setContext(Context(Constants::C_EDIT_MODE, Constants::C_NAVIGATION_PANE));
}
EditMode::~EditMode()