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

@@ -7,7 +7,6 @@
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/coreplugintr.h>
#include <coreplugin/icore.h>
#include <projectexplorer/projectexplorerconstants.h>
@@ -30,14 +29,11 @@
namespace QmlDesigner {
BindingEditorWidget::BindingEditorWidget()
: m_context(new Core::IContext(this))
{
Core::Context context(BINDINGEDITOR_CONTEXT_ID,
ProjectExplorer::Constants::QMLJS_LANGUAGE_ID);
m_context->setWidget(this);
m_context->setContext(context);
Core::ICore::addContextObject(m_context);
Core::IContext::attach(this, context);
Utils::TransientScrollAreaSupport::support(this);