forked from qt-creator/qt-creator
Welcome/PE: Use new IContext::attach() function
Change-Id: I793dfc5b4d9143a71fb388335d33816620c04477 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -912,10 +912,9 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
|||||||
auto splitter = new MiniSplitter(Qt::Vertical);
|
auto splitter = new MiniSplitter(Qt::Vertical);
|
||||||
splitter->addWidget(dd->m_proWindow);
|
splitter->addWidget(dd->m_proWindow);
|
||||||
splitter->addWidget(new OutputPanePlaceHolder(Constants::MODE_SESSION, splitter));
|
splitter->addWidget(new OutputPanePlaceHolder(Constants::MODE_SESSION, splitter));
|
||||||
auto context = new IContext(splitter);
|
|
||||||
context->setWidget(splitter);
|
IContext::attach(splitter, {}, "Managing Projects");
|
||||||
context->setContextHelp("Managing Projects");
|
|
||||||
ICore::addContextObject(context);
|
|
||||||
dd->m_projectsMode.setWidget(splitter);
|
dd->m_projectsMode.setWidget(splitter);
|
||||||
dd->m_projectsMode.setEnabled(false);
|
dd->m_projectsMode.setEnabled(false);
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/find/itemviewfind.h>
|
#include <coreplugin/find/itemviewfind.h>
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/session.h>
|
#include <coreplugin/session.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
@@ -33,12 +32,9 @@
|
|||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
|
||||||
#include <QAbstractTextDocumentLayout>
|
#include <QAbstractTextDocumentLayout>
|
||||||
#include <QApplication>
|
|
||||||
#include <QDir>
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QScrollBar>
|
|
||||||
#include <QStyledItemDelegate>
|
#include <QStyledItemDelegate>
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
@@ -143,7 +139,7 @@ public:
|
|||||||
Internal::TaskModel *m_model;
|
Internal::TaskModel *m_model;
|
||||||
Internal::TaskFilterModel *m_filter;
|
Internal::TaskFilterModel *m_filter;
|
||||||
TaskView m_treeView;
|
TaskView m_treeView;
|
||||||
Core::IContext *m_taskWindowContext;
|
const Core::Context m_taskWindowContext{Core::Context(Core::Constants::C_PROBLEM_PANE)};
|
||||||
QHash<const QAction *, ITaskHandler *> m_actionToHandlerMap;
|
QHash<const QAction *, ITaskHandler *> m_actionToHandlerMap;
|
||||||
ITaskHandler *m_defaultHandler = nullptr;
|
ITaskHandler *m_defaultHandler = nullptr;
|
||||||
QToolButton *m_filterWarningsButton;
|
QToolButton *m_filterWarningsButton;
|
||||||
@@ -194,10 +190,7 @@ TaskWindow::TaskWindow() : d(std::make_unique<TaskWindowPrivate>())
|
|||||||
d->m_treeView.setAttribute(Qt::WA_MacShowFocusRect, false);
|
d->m_treeView.setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||||
d->m_treeView.resizeColumns();
|
d->m_treeView.resizeColumns();
|
||||||
|
|
||||||
d->m_taskWindowContext = new Core::IContext(&d->m_treeView);
|
Core::IContext::attach(&d->m_treeView, d->m_taskWindowContext);
|
||||||
d->m_taskWindowContext->setWidget(&d->m_treeView);
|
|
||||||
d->m_taskWindowContext->setContext(Core::Context(Core::Constants::C_PROBLEM_PANE));
|
|
||||||
Core::ICore::addContextObject(d->m_taskWindowContext);
|
|
||||||
|
|
||||||
connect(d->m_treeView.selectionModel(), &QItemSelectionModel::currentChanged,
|
connect(d->m_treeView.selectionModel(), &QItemSelectionModel::currentChanged,
|
||||||
this, [this](const QModelIndex &index) { d->m_treeView.scrollTo(index); });
|
this, [this](const QModelIndex &index) { d->m_treeView.scrollTo(index); });
|
||||||
@@ -298,7 +291,7 @@ void TaskWindow::delayedInitialization()
|
|||||||
Id id = h->actionManagerId();
|
Id id = h->actionManagerId();
|
||||||
if (id.isValid()) {
|
if (id.isValid()) {
|
||||||
Core::Command *cmd =
|
Core::Command *cmd =
|
||||||
Core::ActionManager::registerAction(action, id, d->m_taskWindowContext->context(), true);
|
Core::ActionManager::registerAction(action, id, d->m_taskWindowContext, true);
|
||||||
action = cmd->action();
|
action = cmd->action();
|
||||||
}
|
}
|
||||||
d->m_treeView.addAction(action);
|
d->m_treeView.addAction(action);
|
||||||
|
|||||||
@@ -345,10 +345,7 @@ WelcomeMode::WelcomeMode()
|
|||||||
spacing(0),
|
spacing(0),
|
||||||
}.attachTo(m_modeWidget);
|
}.attachTo(m_modeWidget);
|
||||||
|
|
||||||
auto context = new IContext(m_modeWidget);
|
IContext::attach(m_modeWidget, {}, "Qt Creator Manual");
|
||||||
context->setWidget(m_modeWidget);
|
|
||||||
context->setContextHelp("Qt Creator Manual");
|
|
||||||
ICore::addContextObject(context);
|
|
||||||
setWidget(m_modeWidget);
|
setWidget(m_modeWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user