forked from qt-creator/qt-creator
QmlDesigner: Register the remaining contexts more directly
The texteditor case remains somewhat special as it modifies the set context after construction. Change-Id: I8dadeff9177db5281d91f7826f06b994ff132883 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -521,7 +521,6 @@ add_qtc_plugin(QmlDesigner
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/designercore #can not be a public dependency -> EXCLUDE_FROM_INSTALL in QmlDesignerCore
|
${CMAKE_CURRENT_LIST_DIR}/designercore #can not be a public dependency -> EXCLUDE_FROM_INSTALL in QmlDesignerCore
|
||||||
${CMAKE_CURRENT_LIST_DIR}/designercore/include #iwidgetplugin.h is used by other plugins
|
${CMAKE_CURRENT_LIST_DIR}/designercore/include #iwidgetplugin.h is used by other plugins
|
||||||
SOURCES
|
SOURCES
|
||||||
designmodecontext.cpp designmodecontext.h
|
|
||||||
designmodewidget.cpp designmodewidget.h
|
designmodewidget.cpp designmodewidget.h
|
||||||
documentmanager.cpp documentmanager.h
|
documentmanager.cpp documentmanager.h
|
||||||
documentwarningwidget.cpp documentwarningwidget.h
|
documentwarningwidget.cpp documentwarningwidget.h
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
#include "designeractionmanager.h"
|
#include "designeractionmanager.h"
|
||||||
#include "designericons.h"
|
#include "designericons.h"
|
||||||
#include "designersettings.h"
|
#include "designersettings.h"
|
||||||
#include "designmodecontext.h"
|
|
||||||
#include "edit3dcanvas.h"
|
#include "edit3dcanvas.h"
|
||||||
#include "edit3dviewconfig.h"
|
#include "edit3dviewconfig.h"
|
||||||
#include "edit3dwidget.h"
|
#include "edit3dwidget.h"
|
||||||
@@ -72,9 +71,6 @@ void Edit3DView::createEdit3DWidget()
|
|||||||
{
|
{
|
||||||
createEdit3DActions();
|
createEdit3DActions();
|
||||||
m_edit3DWidget = new Edit3DWidget(this);
|
m_edit3DWidget = new Edit3DWidget(this);
|
||||||
|
|
||||||
auto editor3DContext = new Internal::Editor3DContext(m_edit3DWidget.data());
|
|
||||||
Core::ICore::addContextObject(editor3DContext);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Edit3DView::checkImports()
|
void Edit3DView::checkImports()
|
||||||
|
|||||||
@@ -47,6 +47,8 @@
|
|||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
using namespace Core;
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
inline static QIcon contextIcon(const DesignerIcons::IconId &iconId)
|
inline static QIcon contextIcon(const DesignerIcons::IconId &iconId)
|
||||||
@@ -186,6 +188,10 @@ Edit3DWidget::Edit3DWidget(Edit3DView *view)
|
|||||||
m_canvas = new Edit3DCanvas(this);
|
m_canvas = new Edit3DCanvas(this);
|
||||||
fillLayout->addWidget(m_canvas.data());
|
fillLayout->addWidget(m_canvas.data());
|
||||||
showCanvas(false);
|
showCanvas(false);
|
||||||
|
|
||||||
|
IContext::attach(this,
|
||||||
|
Context(Constants::C_QMLEDITOR3D, Constants::C_QT_QUICK_TOOLS_MENU),
|
||||||
|
[this](const IContext::HelpCallback &callback) { contextHelp(callback); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void Edit3DWidget::createContextMenu()
|
void Edit3DWidget::createContextMenu()
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
#include <qmldesignerplugin.h>
|
#include <qmldesignerplugin.h>
|
||||||
#include <bindingproperty.h>
|
#include <bindingproperty.h>
|
||||||
#include <designersettings.h>
|
#include <designersettings.h>
|
||||||
#include <designmodecontext.h>
|
|
||||||
#include <model.h>
|
#include <model.h>
|
||||||
#include <modelnode.h>
|
#include <modelnode.h>
|
||||||
#include <nodeabstractproperty.h>
|
#include <nodeabstractproperty.h>
|
||||||
@@ -205,9 +204,6 @@ void FormEditorView::createFormEditorWidget()
|
|||||||
|
|
||||||
m_currentTool = m_selectionTool.get();
|
m_currentTool = m_selectionTool.get();
|
||||||
|
|
||||||
auto formEditorContext = new Internal::FormEditorContext(m_formEditorWidget.data());
|
|
||||||
Core::ICore::addContextObject(formEditorContext);
|
|
||||||
|
|
||||||
connect(m_formEditorWidget->zoomAction(), &ZoomAction::zoomLevelChanged, [this] {
|
connect(m_formEditorWidget->zoomAction(), &ZoomAction::zoomLevelChanged, [this] {
|
||||||
m_currentTool->formEditorItemsChanged(scene()->allFormEditorItems());
|
m_currentTool->formEditorItemsChanged(scene()->allFormEditorItems());
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -41,6 +41,8 @@
|
|||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QWheelEvent>
|
#include <QWheelEvent>
|
||||||
|
|
||||||
|
using namespace Core;
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -292,6 +294,10 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view)
|
|||||||
|
|
||||||
QByteArray sheet = Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css");
|
QByteArray sheet = Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css");
|
||||||
setStyleSheet(Theme::replaceCssColors(QString::fromUtf8(sheet)));
|
setStyleSheet(Theme::replaceCssColors(QString::fromUtf8(sheet)));
|
||||||
|
|
||||||
|
IContext::attach(this,
|
||||||
|
Context(Constants::C_QMLFORMEDITOR, Constants::C_QT_QUICK_TOOLS_MENU),
|
||||||
|
[this](const IContext::HelpCallback &callback) { contextHelp(callback); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormEditorWidget::changeTransformTool(bool checked)
|
void FormEditorWidget::changeTransformTool(bool checked)
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include "bindingproperty.h"
|
#include "bindingproperty.h"
|
||||||
#include "createtexture.h"
|
#include "createtexture.h"
|
||||||
#include "designmodecontext.h"
|
|
||||||
#include "externaldependenciesinterface.h"
|
#include "externaldependenciesinterface.h"
|
||||||
#include "materialbrowsermodel.h"
|
#include "materialbrowsermodel.h"
|
||||||
#include "materialbrowsertexturesmodel.h"
|
#include "materialbrowsertexturesmodel.h"
|
||||||
@@ -62,9 +61,6 @@ WidgetInfo MaterialBrowserView::widgetInfo()
|
|||||||
if (m_widget.isNull()) {
|
if (m_widget.isNull()) {
|
||||||
m_widget = new MaterialBrowserWidget(m_imageCache, this);
|
m_widget = new MaterialBrowserWidget(m_imageCache, this);
|
||||||
|
|
||||||
auto matEditorContext = new Internal::MaterialBrowserContext(m_widget.data());
|
|
||||||
Core::ICore::addContextObject(matEditorContext);
|
|
||||||
|
|
||||||
// custom notifications below are sent to the MaterialEditor
|
// custom notifications below are sent to the MaterialEditor
|
||||||
MaterialBrowserModel *matBrowserModel = m_widget->materialBrowserModel().data();
|
MaterialBrowserModel *matBrowserModel = m_widget->materialBrowserModel().data();
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,8 @@
|
|||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
using namespace Core;
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
static QString propertyEditorResourcesPath()
|
static QString propertyEditorResourcesPath()
|
||||||
@@ -212,6 +214,10 @@ MaterialBrowserWidget::MaterialBrowserWidget(AsynchronousImageCache &imageCache,
|
|||||||
reloadQmlSource();
|
reloadQmlSource();
|
||||||
|
|
||||||
setFocusProxy(m_quickWidget->quickWidget());
|
setFocusProxy(m_quickWidget->quickWidget());
|
||||||
|
|
||||||
|
IContext::attach(this,
|
||||||
|
Context(Constants::C_QMLMATERIALBROWSER, Constants::C_QT_QUICK_TOOLS_MENU),
|
||||||
|
[this](const IContext::HelpCallback &callback) { contextHelp(callback); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaterialBrowserWidget::updateMaterialPreview(const ModelNode &node, const QPixmap &pixmap)
|
void MaterialBrowserWidget::updateMaterialPreview(const ModelNode &node, const QPixmap &pixmap)
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
#include <bindingproperty.h>
|
#include <bindingproperty.h>
|
||||||
#include <commontypecache.h>
|
#include <commontypecache.h>
|
||||||
#include <designersettings.h>
|
#include <designersettings.h>
|
||||||
#include <designmodecontext.h>
|
|
||||||
#include <itemlibraryentry.h>
|
#include <itemlibraryentry.h>
|
||||||
#include <model/modelutils.h>
|
#include <model/modelutils.h>
|
||||||
#include <nodeinstanceview.h>
|
#include <nodeinstanceview.h>
|
||||||
@@ -758,10 +757,6 @@ void NavigatorView::setupWidget()
|
|||||||
{
|
{
|
||||||
m_widget = new NavigatorWidget(this);
|
m_widget = new NavigatorWidget(this);
|
||||||
m_treeModel = new NavigatorTreeModel(this);
|
m_treeModel = new NavigatorTreeModel(this);
|
||||||
|
|
||||||
auto navigatorContext = new Internal::NavigatorContext(m_widget.data());
|
|
||||||
Core::ICore::addContextObject(navigatorContext);
|
|
||||||
|
|
||||||
m_treeModel->setView(this);
|
m_treeModel->setView(this);
|
||||||
m_widget->setTreeModel(m_treeModel.data());
|
m_widget->setTreeModel(m_treeModel.data());
|
||||||
m_currentModelInterface = m_treeModel;
|
m_currentModelInterface = m_treeModel;
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
#include <utils/stylehelper.h>
|
#include <utils/stylehelper.h>
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
|
||||||
|
using namespace Core;
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
NavigatorWidget::NavigatorWidget(NavigatorView *view)
|
NavigatorWidget::NavigatorWidget(NavigatorView *view)
|
||||||
@@ -67,6 +69,10 @@ NavigatorWidget::NavigatorWidget(NavigatorView *view)
|
|||||||
QmlDesignerPlugin::trackWidgetFocusTime(this, Constants::EVENT_NAVIGATORVIEW_TIME);
|
QmlDesignerPlugin::trackWidgetFocusTime(this, Constants::EVENT_NAVIGATORVIEW_TIME);
|
||||||
|
|
||||||
setFocusProxy(m_treeView);
|
setFocusProxy(m_treeView);
|
||||||
|
|
||||||
|
IContext::attach(this,
|
||||||
|
Core::Context(Constants::C_QMLNAVIGATOR, Constants::C_QT_QUICK_TOOLS_MENU),
|
||||||
|
[this](const IContext::HelpCallback &callback) { contextHelp(callback); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigatorWidget::setTreeModel(QAbstractItemModel *model)
|
void NavigatorWidget::setTreeModel(QAbstractItemModel *model)
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
#include "texteditorwidget.h"
|
#include "texteditorwidget.h"
|
||||||
|
|
||||||
#include <customnotifications.h>
|
#include <customnotifications.h>
|
||||||
#include <designmodecontext.h>
|
|
||||||
#include <designdocument.h>
|
#include <designdocument.h>
|
||||||
#include <designersettings.h>
|
#include <designersettings.h>
|
||||||
#include <modelnode.h>
|
#include <modelnode.h>
|
||||||
@@ -14,6 +13,7 @@
|
|||||||
#include <zoomaction.h>
|
#include <zoomaction.h>
|
||||||
#include <nodeabstractproperty.h>
|
#include <nodeabstractproperty.h>
|
||||||
#include <nodelistproperty.h>
|
#include <nodelistproperty.h>
|
||||||
|
#include <qmldesignerconstants.h>
|
||||||
#include <qmldesignerplugin.h>
|
#include <qmldesignerplugin.h>
|
||||||
|
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
@@ -41,6 +41,8 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
|
using namespace Core;
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
const char TEXTEDITOR_CONTEXT_ID[] = "QmlDesigner.TextEditorContext";
|
const char TEXTEDITOR_CONTEXT_ID[] = "QmlDesigner.TextEditorContext";
|
||||||
@@ -48,8 +50,13 @@ const char TEXTEDITOR_CONTEXT_ID[] = "QmlDesigner.TextEditorContext";
|
|||||||
TextEditorView::TextEditorView(ExternalDependenciesInterface &externalDependencies)
|
TextEditorView::TextEditorView(ExternalDependenciesInterface &externalDependencies)
|
||||||
: AbstractView{externalDependencies}
|
: AbstractView{externalDependencies}
|
||||||
, m_widget(new TextEditorWidget(this))
|
, m_widget(new TextEditorWidget(this))
|
||||||
, m_textEditorContext(new Internal::TextEditorContext(m_widget))
|
, m_textEditorContext(new Core::IContext(m_widget))
|
||||||
{
|
{
|
||||||
|
m_textEditorContext->setWidget(m_widget);
|
||||||
|
m_textEditorContext->setContext(Context(Constants::C_QMLTEXTEDITOR, Constants::C_QT_QUICK_TOOLS_MENU));
|
||||||
|
m_textEditorContext->setContextHelpProvider([this](const IContext::HelpCallback &callback) {
|
||||||
|
m_widget->contextHelp(callback);
|
||||||
|
});
|
||||||
Core::ICore::addContextObject(m_textEditorContext);
|
Core::ICore::addContextObject(m_textEditorContext);
|
||||||
|
|
||||||
Core::Context context(TEXTEDITOR_CONTEXT_ID);
|
Core::Context context(TEXTEDITOR_CONTEXT_ID);
|
||||||
|
|||||||
@@ -8,18 +8,10 @@
|
|||||||
|
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
namespace TextEditor { class BaseTextEditor; }
|
namespace TextEditor { class BaseTextEditor; }
|
||||||
|
|
||||||
namespace Utils { class CrumblePath; }
|
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
namespace Internal {
|
|
||||||
class TextEditorContext;
|
|
||||||
}
|
|
||||||
|
|
||||||
class TextEditorWidget;
|
class TextEditorWidget;
|
||||||
|
|
||||||
class QMLDESIGNERCOMPONENTS_EXPORT TextEditorView : public AbstractView
|
class QMLDESIGNERCOMPONENTS_EXPORT TextEditorView : public AbstractView
|
||||||
@@ -85,7 +77,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<TextEditorWidget> m_widget;
|
QPointer<TextEditorWidget> m_widget;
|
||||||
Internal::TextEditorContext *m_textEditorContext;
|
Core::IContext *m_textEditorContext;
|
||||||
bool m_errorState = false;
|
bool m_errorState = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -36,10 +36,6 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
|
||||||
|
|
||||||
#include <designmodecontext.h>
|
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,6 @@
|
|||||||
#include <qmltimeline.h>
|
#include <qmltimeline.h>
|
||||||
#include <qmltimelinekeyframegroup.h>
|
#include <qmltimelinekeyframegroup.h>
|
||||||
|
|
||||||
#include <designmodecontext.h>
|
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/messagebox.h>
|
#include <coreplugin/messagebox.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,76 +0,0 @@
|
|||||||
// Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
||||||
|
|
||||||
#include "designmodecontext.h"
|
|
||||||
#include "assetslibrarywidget.h"
|
|
||||||
#include "designmodewidget.h"
|
|
||||||
#include "edit3dwidget.h"
|
|
||||||
#include "formeditorwidget.h"
|
|
||||||
#include "materialbrowserwidget.h"
|
|
||||||
#include "navigatorwidget.h"
|
|
||||||
#include "qmldesignerconstants.h"
|
|
||||||
#include "texteditorwidget.h"
|
|
||||||
|
|
||||||
namespace QmlDesigner::Internal {
|
|
||||||
|
|
||||||
DesignModeContext::DesignModeContext(QWidget *widget)
|
|
||||||
: IContext(widget)
|
|
||||||
{
|
|
||||||
setWidget(widget);
|
|
||||||
setContext(Core::Context(Constants::C_QMLDESIGNER, Constants::C_QT_QUICK_TOOLS_MENU));
|
|
||||||
setContextHelpProvider([this](const HelpCallback &callback) {
|
|
||||||
qobject_cast<DesignModeWidget *>(m_widget)->contextHelp(callback);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
FormEditorContext::FormEditorContext(QWidget *widget)
|
|
||||||
: IContext(widget)
|
|
||||||
{
|
|
||||||
setWidget(widget);
|
|
||||||
setContext(Core::Context(Constants::C_QMLFORMEDITOR, Constants::C_QT_QUICK_TOOLS_MENU));
|
|
||||||
setContextHelpProvider([this](const HelpCallback &callback) {
|
|
||||||
qobject_cast<FormEditorWidget *>(m_widget)->contextHelp(callback);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Editor3DContext::Editor3DContext(QWidget *widget)
|
|
||||||
: IContext(widget)
|
|
||||||
{
|
|
||||||
setWidget(widget);
|
|
||||||
setContext(Core::Context(Constants::C_QMLEDITOR3D, Constants::C_QT_QUICK_TOOLS_MENU));
|
|
||||||
setContextHelpProvider([this](const HelpCallback &callback) {
|
|
||||||
qobject_cast<Edit3DWidget *>(m_widget)->contextHelp(callback);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
MaterialBrowserContext::MaterialBrowserContext(QWidget *widget)
|
|
||||||
: IContext(widget)
|
|
||||||
{
|
|
||||||
setWidget(widget);
|
|
||||||
setContext(Core::Context(Constants::C_QMLMATERIALBROWSER, Constants::C_QT_QUICK_TOOLS_MENU));
|
|
||||||
setContextHelpProvider([this](const HelpCallback &callback) {
|
|
||||||
qobject_cast<MaterialBrowserWidget *>(m_widget)->contextHelp(callback);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
NavigatorContext::NavigatorContext(QWidget *widget)
|
|
||||||
: IContext(widget)
|
|
||||||
{
|
|
||||||
setWidget(widget);
|
|
||||||
setContext(Core::Context(Constants::C_QMLNAVIGATOR, Constants::C_QT_QUICK_TOOLS_MENU));
|
|
||||||
setContextHelpProvider([this](const HelpCallback &callback) {
|
|
||||||
qobject_cast<NavigatorWidget *>(m_widget)->contextHelp(callback);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
TextEditorContext::TextEditorContext(QWidget *widget)
|
|
||||||
: IContext(widget)
|
|
||||||
{
|
|
||||||
setWidget(widget);
|
|
||||||
setContext(Core::Context(Constants::C_QMLTEXTEDITOR, Constants::C_QT_QUICK_TOOLS_MENU));
|
|
||||||
setContextHelpProvider([this](const HelpCallback &callback) {
|
|
||||||
qobject_cast<TextEditorWidget *>(m_widget)->contextHelp(callback);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace QmlDesigner::Internal
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
// Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <coreplugin/icontext.h>
|
|
||||||
|
|
||||||
namespace QmlDesigner {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bauhaus Design mode context object
|
|
||||||
*/
|
|
||||||
class DesignModeContext : public Core::IContext
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
DesignModeContext(QWidget *widget);
|
|
||||||
};
|
|
||||||
|
|
||||||
class FormEditorContext : public Core::IContext
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
FormEditorContext(QWidget *widget);
|
|
||||||
};
|
|
||||||
|
|
||||||
class Editor3DContext : public Core::IContext
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
Editor3DContext(QWidget *widget);
|
|
||||||
};
|
|
||||||
|
|
||||||
class MaterialBrowserContext : public Core::IContext
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
MaterialBrowserContext(QWidget *widget);
|
|
||||||
};
|
|
||||||
|
|
||||||
class NavigatorContext : public Core::IContext
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
NavigatorContext(QWidget *widget);
|
|
||||||
};
|
|
||||||
|
|
||||||
class TextEditorContext : public Core::IContext
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
TextEditorContext(QWidget *widget);
|
|
||||||
};
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace QmlDesigner
|
|
||||||
@@ -55,9 +55,7 @@
|
|||||||
#include <advanceddockingsystem/docksplitter.h>
|
#include <advanceddockingsystem/docksplitter.h>
|
||||||
#include <advanceddockingsystem/iconprovider.h>
|
#include <advanceddockingsystem/iconprovider.h>
|
||||||
|
|
||||||
using Core::MiniSplitter;
|
using namespace Core;
|
||||||
using Core::IEditor;
|
|
||||||
using Core::EditorManager;
|
|
||||||
|
|
||||||
using namespace QmlDesigner;
|
using namespace QmlDesigner;
|
||||||
|
|
||||||
@@ -121,6 +119,10 @@ DesignModeWidget::DesignModeWidget()
|
|||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
if (Utils::StyleHelper::isQDSTheme() || Core::ICore::isQtDesignStudio())
|
if (Utils::StyleHelper::isQDSTheme() || Core::ICore::isQtDesignStudio())
|
||||||
qApp->setStyle(QmlDesignerBasePlugin::style());
|
qApp->setStyle(QmlDesignerBasePlugin::style());
|
||||||
|
|
||||||
|
IContext::attach(this,
|
||||||
|
Context(Constants::C_QMLDESIGNER, Constants::C_QT_QUICK_TOOLS_MENU),
|
||||||
|
[this](const IContext::HelpCallback &callback) { contextHelp(callback); });
|
||||||
}
|
}
|
||||||
|
|
||||||
DesignModeWidget::~DesignModeWidget()
|
DesignModeWidget::~DesignModeWidget()
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
#include "qmldesignertr.h"
|
#include "qmldesignertr.h"
|
||||||
|
|
||||||
#include "coreplugin/iwizardfactory.h"
|
#include "coreplugin/iwizardfactory.h"
|
||||||
#include "designmodecontext.h"
|
|
||||||
#include "designmodewidget.h"
|
#include "designmodewidget.h"
|
||||||
#include "dynamiclicensecheck.h"
|
#include "dynamiclicensecheck.h"
|
||||||
#include "exception.h"
|
#include "exception.h"
|
||||||
@@ -90,6 +89,7 @@
|
|||||||
|
|
||||||
static Q_LOGGING_CATEGORY(qmldesignerLog, "qtc.qmldesigner", QtWarningMsg)
|
static Q_LOGGING_CATEGORY(qmldesignerLog, "qtc.qmldesigner", QtWarningMsg)
|
||||||
|
|
||||||
|
using namespace Core;
|
||||||
using namespace QmlDesigner::Internal;
|
using namespace QmlDesigner::Internal;
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
@@ -380,10 +380,13 @@ static QString projectPath(const Utils::FilePath &fileName)
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlDesignerPlugin::integrateIntoQtCreator(QWidget *modeWidget)
|
void QmlDesignerPlugin::integrateIntoQtCreator(DesignModeWidget *modeWidget)
|
||||||
{
|
{
|
||||||
auto context = new Internal::DesignModeContext(modeWidget);
|
const Context context(Constants::C_QMLDESIGNER, Constants::C_QT_QUICK_TOOLS_MENU);
|
||||||
Core::ICore::addContextObject(context);
|
IContext::attach(modeWidget, context, [modeWidget](const IContext::HelpCallback &callback) {
|
||||||
|
modeWidget->contextHelp(callback);
|
||||||
|
});
|
||||||
|
|
||||||
Core::Context qmlDesignerMainContext(Constants::C_QMLDESIGNER);
|
Core::Context qmlDesignerMainContext(Constants::C_QMLDESIGNER);
|
||||||
Core::Context qmlDesignerFormEditorContext(Constants::C_QMLFORMEDITOR);
|
Core::Context qmlDesignerFormEditorContext(Constants::C_QMLFORMEDITOR);
|
||||||
Core::Context qmlDesignerEditor3dContext(Constants::C_QMLEDITOR3D);
|
Core::Context qmlDesignerEditor3dContext(Constants::C_QMLEDITOR3D);
|
||||||
@@ -397,7 +400,7 @@ void QmlDesignerPlugin::integrateIntoQtCreator(QWidget *modeWidget)
|
|||||||
const QStringList mimeTypes = { Utils::Constants::QML_MIMETYPE,
|
const QStringList mimeTypes = { Utils::Constants::QML_MIMETYPE,
|
||||||
Utils::Constants::QMLUI_MIMETYPE };
|
Utils::Constants::QMLUI_MIMETYPE };
|
||||||
|
|
||||||
Core::DesignMode::registerDesignWidget(modeWidget, mimeTypes, context->context());
|
Core::DesignMode::registerDesignWidget(modeWidget, mimeTypes, context);
|
||||||
|
|
||||||
connect(Core::DesignMode::instance(), &Core::DesignMode::actionsUpdated,
|
connect(Core::DesignMode::instance(), &Core::DesignMode::actionsUpdated,
|
||||||
&d->shortCutManager, &ShortCutManager::updateActions);
|
&d->shortCutManager, &ShortCutManager::updateActions);
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ private slots:
|
|||||||
|
|
||||||
private: // functions
|
private: // functions
|
||||||
void lauchFeedbackPopupInternal(const QString &identifier);
|
void lauchFeedbackPopupInternal(const QString &identifier);
|
||||||
void integrateIntoQtCreator(QWidget *modeWidget);
|
void integrateIntoQtCreator(Internal::DesignModeWidget *modeWidget);
|
||||||
void clearDesigner();
|
void clearDesigner();
|
||||||
void resetDesignerDocument();
|
void resetDesignerDocument();
|
||||||
void setupDesigner();
|
void setupDesigner();
|
||||||
|
|||||||
Reference in New Issue
Block a user