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

@@ -142,11 +142,8 @@ public:
setDragDropMode(QAbstractItemView::DragDrop);
viewport()->setAcceptDrops(true);
setDropIndicatorShown(true);
auto context = new IContext(this);
context->setContext(Context(ProjectExplorer::Constants::C_PROJECT_TREE));
context->setWidget(this);
ICore::addContextObject(context);
IContext::attach(this, Context(ProjectExplorer::Constants::C_PROJECT_TREE));
connect(this, &ProjectTreeView::expanded,
this, &ProjectTreeView::invalidateSize);