forked from qt-creator/qt-creator
QmlDesigner: modernize code style
- no behavior changes - using nullptr - renaming data -> d - transform single used small slot function to lambdas Change-Id: Ifae389b8a865b0b6a501b6f3d60597a66d9febe8 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
This commit is contained in:
@@ -1928,19 +1928,19 @@ void TextToModelMerger::collectSemanticErrorsAndWarnings(QList<RewriterError> *e
|
|||||||
|
|
||||||
check.enableQmlDesignerChecks();
|
check.enableQmlDesignerChecks();
|
||||||
|
|
||||||
|
QUrl fileNameUrl = QUrl::fromLocalFile(m_document->fileName());
|
||||||
foreach (const StaticAnalysis::Message &message, check()) {
|
foreach (const StaticAnalysis::Message &message, check()) {
|
||||||
if (message.severity == Severity::Error) {
|
if (message.severity == Severity::Error) {
|
||||||
if (message.type == StaticAnalysis::ErrUnknownComponent)
|
if (message.type == StaticAnalysis::ErrUnknownComponent)
|
||||||
warnings->append(RewriterError(message.toDiagnosticMessage(), QUrl::fromLocalFile(m_document->fileName())));
|
warnings->append(RewriterError(message.toDiagnosticMessage(), fileNameUrl));
|
||||||
else
|
else
|
||||||
errors->append(RewriterError(message.toDiagnosticMessage(), QUrl::fromLocalFile(m_document->fileName())));
|
errors->append(RewriterError(message.toDiagnosticMessage(), fileNameUrl));
|
||||||
}
|
}
|
||||||
if (message.severity == Severity::Warning) {
|
if (message.severity == Severity::Warning) {
|
||||||
if (message.type == StaticAnalysis::WarnAboutQtQuick1InsteadQtQuick2) {
|
if (message.type == StaticAnalysis::WarnAboutQtQuick1InsteadQtQuick2)
|
||||||
errors->append(RewriterError(message.toDiagnosticMessage(), QUrl::fromLocalFile(m_document->fileName())));
|
errors->append(RewriterError(message.toDiagnosticMessage(), fileNameUrl));
|
||||||
} else {
|
else
|
||||||
warnings->append(RewriterError(message.toDiagnosticMessage(), QUrl::fromLocalFile(m_document->fileName())));
|
warnings->append(RewriterError(message.toDiagnosticMessage(), fileNameUrl));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -179,7 +179,8 @@ DesignModeWidget::DesignModeWidget(QWidget *parent) :
|
|||||||
m_navigatorHistoryCounter(-1),
|
m_navigatorHistoryCounter(-1),
|
||||||
m_keepNavigatorHistory(false)
|
m_keepNavigatorHistory(false)
|
||||||
{
|
{
|
||||||
QObject::connect(viewManager().nodeInstanceView(), SIGNAL(qmlPuppetCrashed()), this, SLOT(showQmlPuppetCrashedError()));
|
connect(viewManager().nodeInstanceView(), &NodeInstanceView::qmlPuppetCrashed,
|
||||||
|
this, &DesignModeWidget::showQmlPuppetCrashedError);
|
||||||
}
|
}
|
||||||
|
|
||||||
DesignModeWidget::~DesignModeWidget()
|
DesignModeWidget::~DesignModeWidget()
|
||||||
@@ -288,7 +289,7 @@ void DesignModeWidget::updateErrorStatus(const QList<RewriterError> &errors)
|
|||||||
enableWidgets();
|
enableWidgets();
|
||||||
} else if (!errors.isEmpty()) {
|
} else if (!errors.isEmpty()) {
|
||||||
disableWidgets();
|
disableWidgets();
|
||||||
showErrorMessage(errors);
|
showMessageBox(errors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,12 +351,8 @@ void DesignModeWidget::setup()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QToolBar *toolBar = new QToolBar;
|
QToolBar *toolBar = new QToolBar;
|
||||||
|
|
||||||
toolBar->addAction(viewManager().componentViewAction());
|
toolBar->addAction(viewManager().componentViewAction());
|
||||||
|
|
||||||
toolBar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
toolBar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||||
m_toolBar->addCenterToolBar(toolBar);
|
m_toolBar->addCenterToolBar(toolBar);
|
||||||
|
|
||||||
@@ -404,11 +401,20 @@ void DesignModeWidget::setup()
|
|||||||
m_leftSideBar.reset(new Core::SideBar(sideBarItems, leftSideBarItems));
|
m_leftSideBar.reset(new Core::SideBar(sideBarItems, leftSideBarItems));
|
||||||
m_rightSideBar.reset(new Core::SideBar(sideBarItems, rightSideBarItems));
|
m_rightSideBar.reset(new Core::SideBar(sideBarItems, rightSideBarItems));
|
||||||
|
|
||||||
connect(m_leftSideBar.data(), SIGNAL(availableItemsChanged()), SLOT(updateAvailableSidebarItemsRight()));
|
connect(m_leftSideBar.data(), &Core::SideBar::availableItemsChanged, [=](){
|
||||||
connect(m_rightSideBar.data(), SIGNAL(availableItemsChanged()), SLOT(updateAvailableSidebarItemsLeft()));
|
// event comes from m_leftSidebar, so update right side.
|
||||||
|
m_rightSideBar->setUnavailableItemIds(m_leftSideBar->unavailableItemIds());
|
||||||
|
});
|
||||||
|
|
||||||
connect(Core::ICore::instance(), SIGNAL(coreAboutToClose()),
|
connect(m_rightSideBar.data(), &Core::SideBar::availableItemsChanged, [=](){
|
||||||
this, SLOT(deleteSidebarWidgets()));
|
// event comes from m_rightSidebar, so update left side.
|
||||||
|
m_leftSideBar->setUnavailableItemIds(m_rightSideBar->unavailableItemIds());
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(Core::ICore::instance(), &Core::ICore::coreAboutToClose, [=](){
|
||||||
|
m_leftSideBar.reset();
|
||||||
|
m_rightSideBar.reset();
|
||||||
|
});
|
||||||
|
|
||||||
m_toolBar->setToolbarCreationFlags(Core::EditorToolBar::FlagsStandalone);
|
m_toolBar->setToolbarCreationFlags(Core::EditorToolBar::FlagsStandalone);
|
||||||
m_toolBar->setNavigationVisible(true);
|
m_toolBar->setNavigationVisible(true);
|
||||||
@@ -445,24 +451,6 @@ void DesignModeWidget::setup()
|
|||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DesignModeWidget::updateAvailableSidebarItemsRight()
|
|
||||||
{
|
|
||||||
// event comes from m_leftSidebar, so update right side.
|
|
||||||
m_rightSideBar->setUnavailableItemIds(m_leftSideBar->unavailableItemIds());
|
|
||||||
}
|
|
||||||
|
|
||||||
void DesignModeWidget::updateAvailableSidebarItemsLeft()
|
|
||||||
{
|
|
||||||
// event comes from m_rightSidebar, so update left side.
|
|
||||||
m_leftSideBar->setUnavailableItemIds(m_rightSideBar->unavailableItemIds());
|
|
||||||
}
|
|
||||||
|
|
||||||
void DesignModeWidget::deleteSidebarWidgets()
|
|
||||||
{
|
|
||||||
m_leftSideBar.reset();
|
|
||||||
m_rightSideBar.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DesignModeWidget::showQmlPuppetCrashedError()
|
void DesignModeWidget::showQmlPuppetCrashedError()
|
||||||
{
|
{
|
||||||
QList<RewriterError> errorList;
|
QList<RewriterError> errorList;
|
||||||
@@ -470,7 +458,7 @@ void DesignModeWidget::showQmlPuppetCrashedError()
|
|||||||
errorList.append(error);
|
errorList.append(error);
|
||||||
|
|
||||||
disableWidgets();
|
disableWidgets();
|
||||||
showErrorMessage(errorList);
|
showMessageBox(errorList);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DesignModeWidget::toolBarOnGoBackClicked()
|
void DesignModeWidget::toolBarOnGoBackClicked()
|
||||||
@@ -622,7 +610,7 @@ QWidget *DesignModeWidget::createCrumbleBarFrame()
|
|||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DesignModeWidget::showErrorMessage(const QList<RewriterError> &errors)
|
void DesignModeWidget::showMessageBox(const QList<RewriterError> &errors)
|
||||||
{
|
{
|
||||||
Q_ASSERT(!errors.isEmpty());
|
Q_ASSERT(!errors.isEmpty());
|
||||||
m_warningWidget->setError(errors.first());
|
m_warningWidget->setError(errors.first());
|
||||||
|
@@ -100,7 +100,7 @@ public:
|
|||||||
|
|
||||||
void enableWidgets();
|
void enableWidgets();
|
||||||
void disableWidgets();
|
void disableWidgets();
|
||||||
void showErrorMessage(const QList<RewriterError> &errors);
|
void showMessageBox(const QList<RewriterError> &errors);
|
||||||
|
|
||||||
CrumbleBar* crumbleBar() const;
|
CrumbleBar* crumbleBar() const;
|
||||||
|
|
||||||
@@ -112,10 +112,6 @@ public slots:
|
|||||||
void toggleRightSidebar();
|
void toggleRightSidebar();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updateAvailableSidebarItemsLeft();
|
|
||||||
void updateAvailableSidebarItemsRight();
|
|
||||||
|
|
||||||
void deleteSidebarWidgets();
|
|
||||||
void showQmlPuppetCrashedError();
|
void showQmlPuppetCrashedError();
|
||||||
|
|
||||||
void toolBarOnGoBackClicked();
|
void toolBarOnGoBackClicked();
|
||||||
@@ -136,7 +132,9 @@ private: // functions
|
|||||||
QWidget *createCrumbleBarFrame();
|
QWidget *createCrumbleBarFrame();
|
||||||
|
|
||||||
private: // variables
|
private: // variables
|
||||||
QSplitter *m_mainSplitter;
|
QSplitter *m_mainSplitter = nullptr;
|
||||||
|
DocumentWarningWidget *m_warningWidget = nullptr;
|
||||||
|
|
||||||
QScopedPointer<Core::SideBar> m_leftSideBar;
|
QScopedPointer<Core::SideBar> m_leftSideBar;
|
||||||
QScopedPointer<Core::SideBar> m_rightSideBar;
|
QScopedPointer<Core::SideBar> m_rightSideBar;
|
||||||
QPointer<QWidget> m_topSideBar;
|
QPointer<QWidget> m_topSideBar;
|
||||||
@@ -147,7 +145,6 @@ private: // variables
|
|||||||
|
|
||||||
InitializeStatus m_initStatus;
|
InitializeStatus m_initStatus;
|
||||||
|
|
||||||
DocumentWarningWidget *m_warningWidget;
|
|
||||||
QStringList m_navigatorHistory;
|
QStringList m_navigatorHistory;
|
||||||
int m_navigatorHistoryCounter;
|
int m_navigatorHistoryCounter;
|
||||||
bool m_keepNavigatorHistory;
|
bool m_keepNavigatorHistory;
|
||||||
|
@@ -278,7 +278,7 @@ void DocumentManager::setCurrentDesignDocument(Core::IEditor *editor)
|
|||||||
{
|
{
|
||||||
if (editor) {
|
if (editor) {
|
||||||
m_currentDesignDocument = m_designDocumentHash.value(editor);
|
m_currentDesignDocument = m_designDocumentHash.value(editor);
|
||||||
if (m_currentDesignDocument == 0) {
|
if (m_currentDesignDocument == nullptr) {
|
||||||
m_currentDesignDocument = new DesignDocument;
|
m_currentDesignDocument = new DesignDocument;
|
||||||
m_designDocumentHash.insert(editor, m_currentDesignDocument);
|
m_designDocumentHash.insert(editor, m_currentDesignDocument);
|
||||||
m_currentDesignDocument->setEditor(editor);
|
m_currentDesignDocument->setEditor(editor);
|
||||||
@@ -405,7 +405,7 @@ void DocumentManager::findPathToIsoProFile(bool *iconResourceFileAlreadyExists,
|
|||||||
Utils::FileName qmlFileName = QmlDesignerPlugin::instance()->currentDesignDocument()->fileName();
|
Utils::FileName qmlFileName = QmlDesignerPlugin::instance()->currentDesignDocument()->fileName();
|
||||||
ProjectExplorer::Project *project = ProjectExplorer::SessionManager::projectForFile(qmlFileName);
|
ProjectExplorer::Project *project = ProjectExplorer::SessionManager::projectForFile(qmlFileName);
|
||||||
ProjectExplorer::Node *node = ProjectExplorer::SessionManager::nodeForFile(qmlFileName)->parentFolderNode();
|
ProjectExplorer::Node *node = ProjectExplorer::SessionManager::nodeForFile(qmlFileName)->parentFolderNode();
|
||||||
ProjectExplorer::Node *iconQrcFileNode = 0;
|
ProjectExplorer::Node *iconQrcFileNode = nullptr;
|
||||||
|
|
||||||
while (node && !iconQrcFileNode) {
|
while (node && !iconQrcFileNode) {
|
||||||
qCDebug(documentManagerLog) << "Checking" << node->displayName() << "(" << node << node->nodeType() << ")";
|
qCDebug(documentManagerLog) << "Checking" << node->displayName() << "(" << node << node->nodeType() << ")";
|
||||||
|
@@ -64,12 +64,14 @@
|
|||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
class QmlDesignerPluginData {
|
class QmlDesignerPluginPrivate {
|
||||||
public:
|
public:
|
||||||
ViewManager viewManager;
|
ViewManager viewManager;
|
||||||
DocumentManager documentManager;
|
DocumentManager documentManager;
|
||||||
ShortCutManager shortCutManager;
|
ShortCutManager shortCutManager;
|
||||||
|
|
||||||
|
QMetaObject::Connection rewriterErrorConnection;
|
||||||
|
|
||||||
Internal::DesignModeWidget *mainWidget;
|
Internal::DesignModeWidget *mainWidget;
|
||||||
|
|
||||||
QmlDesigner::PluginManager pluginManager;
|
QmlDesigner::PluginManager pluginManager;
|
||||||
@@ -77,21 +79,59 @@ public:
|
|||||||
Internal::DesignModeContext *context;
|
Internal::DesignModeContext *context;
|
||||||
};
|
};
|
||||||
|
|
||||||
QmlDesignerPlugin *QmlDesignerPlugin::m_instance = 0;
|
QmlDesignerPlugin *QmlDesignerPlugin::m_instance = nullptr;
|
||||||
|
|
||||||
static bool isInDesignerMode()
|
static bool isInDesignerMode()
|
||||||
{
|
{
|
||||||
return Core::ModeManager::currentMode() == Core::Constants::MODE_DESIGN;
|
return Core::ModeManager::currentMode() == Core::Constants::MODE_DESIGN;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool shouldAssertInException()
|
static bool checkIfEditorIsQtQuick(Core::IEditor *editor)
|
||||||
|
{
|
||||||
|
if (editor)
|
||||||
|
if (editor && editor->document()->id() == QmlJSEditor::Constants::C_QMLJSEDITOR_ID) {
|
||||||
|
QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
|
||||||
|
QmlJS::Document::Ptr document = modelManager->ensuredGetDocumentForPath(editor->document()->filePath().toString());
|
||||||
|
if (!document.isNull())
|
||||||
|
return document->language() == QmlJS::Dialect::QmlQtQuick1
|
||||||
|
|| document->language() == QmlJS::Dialect::QmlQtQuick2
|
||||||
|
|| document->language() == QmlJS::Dialect::QmlQtQuick2Ui
|
||||||
|
|| document->language() == QmlJS::Dialect::Qml;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool isDesignerMode(Core::Id mode)
|
||||||
|
{
|
||||||
|
return mode == Core::DesignMode::instance()->id();
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool documentIsAlreadyOpen(DesignDocument *designDocument, Core::IEditor *editor, Core::Id newMode)
|
||||||
|
{
|
||||||
|
return designDocument
|
||||||
|
&& editor == designDocument->editor()
|
||||||
|
&& isDesignerMode(newMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool shouldAssertInException()
|
||||||
{
|
{
|
||||||
QProcessEnvironment processEnvironment = QProcessEnvironment::systemEnvironment();
|
QProcessEnvironment processEnvironment = QProcessEnvironment::systemEnvironment();
|
||||||
return !processEnvironment.value("QMLDESIGNER_ASSERT_ON_EXCEPTION").isEmpty();
|
return !processEnvironment.value("QMLDESIGNER_ASSERT_ON_EXCEPTION").isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void switchTextDesign()
|
||||||
|
{
|
||||||
|
if (Core::ModeManager::currentMode() == Core::Constants::MODE_EDIT) {
|
||||||
|
Core::IEditor *editor = Core::EditorManager::currentEditor();
|
||||||
|
if (checkIfEditorIsQtQuick(editor))
|
||||||
|
Core::ModeManager::activateMode(Core::Constants::MODE_DESIGN);
|
||||||
|
} else if (Core::ModeManager::currentMode() == Core::Constants::MODE_DESIGN) {
|
||||||
|
Core::ModeManager::activateMode(Core::Constants::MODE_EDIT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QmlDesignerPlugin::QmlDesignerPlugin()
|
QmlDesignerPlugin::QmlDesignerPlugin()
|
||||||
: data(0)
|
|
||||||
{
|
{
|
||||||
m_instance = this;
|
m_instance = this;
|
||||||
// Exceptions should never ever assert: they are handled in a number of
|
// Exceptions should never ever assert: they are handled in a number of
|
||||||
@@ -110,13 +150,14 @@ QmlDesignerPlugin::QmlDesignerPlugin()
|
|||||||
|
|
||||||
QmlDesignerPlugin::~QmlDesignerPlugin()
|
QmlDesignerPlugin::~QmlDesignerPlugin()
|
||||||
{
|
{
|
||||||
if (data) {
|
if (d) {
|
||||||
Core::DesignMode::instance()->unregisterDesignWidget(data->mainWidget);
|
Core::DesignMode::instance()->unregisterDesignWidget(d->mainWidget);
|
||||||
Core::ICore::removeContextObject(data->context);
|
Core::ICore::removeContextObject(d->context);
|
||||||
data->context = 0;
|
d->context = nullptr;
|
||||||
}
|
}
|
||||||
delete data;
|
delete d;
|
||||||
m_instance = 0;
|
d = nullptr;
|
||||||
|
m_instance = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
@@ -129,34 +170,32 @@ bool QmlDesignerPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
|||||||
if (!Utils::HostOsInfo::canCreateOpenGLContext(errorMessage))
|
if (!Utils::HostOsInfo::canCreateOpenGLContext(errorMessage))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
data = new QmlDesignerPluginData;
|
d = new QmlDesignerPluginPrivate;
|
||||||
|
|
||||||
data->settings.fromSettings(Core::ICore::settings());
|
d->settings.fromSettings(Core::ICore::settings());
|
||||||
|
|
||||||
data->viewManager.registerViewTakingOwnership(new QmlDesigner::Internal::ConnectionView());
|
d->viewManager.registerViewTakingOwnership(new QmlDesigner::Internal::ConnectionView());
|
||||||
data->viewManager.registerFormEditorToolTakingOwnership(new QmlDesigner::SourceTool);
|
d->viewManager.registerFormEditorToolTakingOwnership(new QmlDesigner::SourceTool);
|
||||||
data->viewManager.registerFormEditorToolTakingOwnership(new QmlDesigner::ColorTool);
|
d->viewManager.registerFormEditorToolTakingOwnership(new QmlDesigner::ColorTool);
|
||||||
data->viewManager.registerFormEditorToolTakingOwnership(new QmlDesigner::TextTool);
|
d->viewManager.registerFormEditorToolTakingOwnership(new QmlDesigner::TextTool);
|
||||||
data->viewManager.registerFormEditorToolTakingOwnership(new QmlDesigner::PathTool);
|
d->viewManager.registerFormEditorToolTakingOwnership(new QmlDesigner::PathTool);
|
||||||
|
|
||||||
const Core::Context switchContext(QmlDesigner::Constants::C_QMLDESIGNER,
|
const Core::Context switchContext(QmlDesigner::Constants::C_QMLDESIGNER,
|
||||||
QmlJSEditor::Constants::C_QMLJSEDITOR_ID);
|
QmlJSEditor::Constants::C_QMLJSEDITOR_ID);
|
||||||
|
|
||||||
QAction *switchAction = new QAction(tr("Switch Text/Design"), this);
|
QAction *switchTextDesignAction = new QAction(tr("Switch Text/Design"), this);
|
||||||
Core::Command *command = Core::ActionManager::registerAction(
|
Core::Command *command = Core::ActionManager::registerAction(
|
||||||
switchAction, QmlDesigner::Constants::SWITCH_TEXT_DESIGN, switchContext);
|
switchTextDesignAction, QmlDesigner::Constants::SWITCH_TEXT_DESIGN, switchContext);
|
||||||
command->setDefaultKeySequence(QKeySequence(Qt::Key_F4));
|
command->setDefaultKeySequence(QKeySequence(Qt::Key_F4));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const QString pluginPath = Utils::HostOsInfo::isMacHost()
|
const QString pluginPath = Utils::HostOsInfo::isMacHost()
|
||||||
? QString(QCoreApplication::applicationDirPath() + "/../PlugIns/QmlDesigner")
|
? QString(QCoreApplication::applicationDirPath() + "/../PlugIns/QmlDesigner")
|
||||||
: QString(QCoreApplication::applicationDirPath() + "/../"
|
: QString(QCoreApplication::applicationDirPath() + "/../"
|
||||||
+ QLatin1String(IDE_LIBRARY_BASENAME) + "/qtcreator/plugins/qmldesigner");
|
+ QLatin1String(IDE_LIBRARY_BASENAME) + "/qtcreator/plugins/qmldesigner");
|
||||||
data->pluginManager.setPluginPaths(QStringList() << pluginPath);
|
d->pluginManager.setPluginPaths(QStringList() << pluginPath);
|
||||||
|
|
||||||
createDesignModeWidget();
|
createDesignModeWidget();
|
||||||
connect(switchAction, SIGNAL(triggered()), this, SLOT(switchTextDesign()));
|
connect(switchTextDesignAction, &QAction::triggered, this, &switchTextDesign);
|
||||||
|
|
||||||
addAutoReleasedObject(new Internal::SettingsPage);
|
addAutoReleasedObject(new Internal::SettingsPage);
|
||||||
|
|
||||||
@@ -169,64 +208,77 @@ void QmlDesignerPlugin::extensionsInitialized()
|
|||||||
mimeTypes.append(QmlJSTools::Constants::QML_MIMETYPE);
|
mimeTypes.append(QmlJSTools::Constants::QML_MIMETYPE);
|
||||||
mimeTypes.append(QmlJSTools::Constants::QMLUI_MIMETYPE);
|
mimeTypes.append(QmlJSTools::Constants::QMLUI_MIMETYPE);
|
||||||
|
|
||||||
Core::DesignMode::instance()->registerDesignWidget(data->mainWidget, mimeTypes, data->context->context());
|
Core::DesignMode::instance()->registerDesignWidget(d->mainWidget, mimeTypes, d->context->context());
|
||||||
connect(Core::DesignMode::instance(),
|
connect(Core::DesignMode::instance(), &Core::DesignMode::actionsUpdated,
|
||||||
SIGNAL(actionsUpdated(Core::IEditor*)),
|
&d->shortCutManager, &ShortCutManager::updateActions);
|
||||||
&data->shortCutManager,
|
|
||||||
SLOT(updateActions(Core::IEditor*)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlDesignerPlugin::createDesignModeWidget()
|
void QmlDesignerPlugin::createDesignModeWidget()
|
||||||
{
|
{
|
||||||
data->mainWidget = new Internal::DesignModeWidget;
|
d->mainWidget = new Internal::DesignModeWidget;
|
||||||
|
|
||||||
data->context = new Internal::DesignModeContext(data->mainWidget);
|
d->context = new Internal::DesignModeContext(d->mainWidget);
|
||||||
Core::ICore::addContextObject(data->context);
|
Core::ICore::addContextObject(d->context);
|
||||||
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 qmlDesignerNavigatorContext(Constants::C_QMLNAVIGATOR);
|
Core::Context qmlDesignerNavigatorContext(Constants::C_QMLNAVIGATOR);
|
||||||
|
|
||||||
data->context->context().add(qmlDesignerMainContext);
|
d->context->context().add(qmlDesignerMainContext);
|
||||||
data->context->context().add(qmlDesignerFormEditorContext);
|
d->context->context().add(qmlDesignerFormEditorContext);
|
||||||
data->context->context().add(qmlDesignerNavigatorContext);
|
d->context->context().add(qmlDesignerNavigatorContext);
|
||||||
data->context->context().add(ProjectExplorer::Constants::LANG_QMLJS);
|
d->context->context().add(ProjectExplorer::Constants::LANG_QMLJS);
|
||||||
|
|
||||||
data->shortCutManager.registerActions(qmlDesignerMainContext, qmlDesignerFormEditorContext, qmlDesignerNavigatorContext);
|
d->shortCutManager.registerActions(qmlDesignerMainContext, qmlDesignerFormEditorContext, qmlDesignerNavigatorContext);
|
||||||
|
|
||||||
connect(Core::EditorManager::instance(),
|
connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged, [=] (Core::IEditor *editor) {
|
||||||
SIGNAL(currentEditorChanged(Core::IEditor*)),
|
if (d && checkIfEditorIsQtQuick(editor) && isInDesignerMode()) {
|
||||||
this,
|
d->shortCutManager.updateActions(editor);
|
||||||
SLOT(onCurrentEditorChanged(Core::IEditor*)));
|
changeEditor();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
connect(Core::EditorManager::instance(),
|
connect(Core::EditorManager::instance(), &Core::EditorManager::editorsClosed, [=] (QList<Core::IEditor*> editors) {
|
||||||
SIGNAL(editorsClosed(QList<Core::IEditor*>)),
|
if (d) {
|
||||||
this,
|
if (d->documentManager.hasCurrentDesignDocument()
|
||||||
SLOT(onTextEditorsClosed(QList<Core::IEditor*>)));
|
&& editors.contains(d->documentManager.currentDesignDocument()->textEditor()))
|
||||||
|
hideDesigner();
|
||||||
|
|
||||||
|
d->documentManager.removeEditors(editors);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
connect(Core::ModeManager::instance(), &Core::ModeManager::currentModeChanged,
|
connect(Core::ModeManager::instance(), &Core::ModeManager::currentModeChanged,
|
||||||
this, &QmlDesignerPlugin::onCurrentModeChanged);
|
[=] (Core::Id newMode, Core::Id oldMode) {
|
||||||
|
if (d && Core::EditorManager::currentEditor() && checkIfEditorIsQtQuick
|
||||||
|
(Core::EditorManager::currentEditor()) && !documentIsAlreadyOpen(
|
||||||
|
currentDesignDocument(), Core::EditorManager::currentEditor(), newMode)) {
|
||||||
|
|
||||||
|
if (!isDesignerMode(newMode) && isDesignerMode(oldMode))
|
||||||
|
hideDesigner();
|
||||||
|
else if (Core::EditorManager::currentEditor() && isDesignerMode(newMode))
|
||||||
|
showDesigner();
|
||||||
|
else if (currentDesignDocument())
|
||||||
|
hideDesigner();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlDesignerPlugin::showDesigner()
|
void QmlDesignerPlugin::showDesigner()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!data->documentManager.hasCurrentDesignDocument(), return);
|
QTC_ASSERT(!d->documentManager.hasCurrentDesignDocument(), return);
|
||||||
|
|
||||||
data->shortCutManager.disconnectUndoActions(currentDesignDocument());
|
d->shortCutManager.disconnectUndoActions(currentDesignDocument());
|
||||||
|
d->documentManager.setCurrentDesignDocument(Core::EditorManager::currentEditor());
|
||||||
|
d->shortCutManager.connectUndoActions(currentDesignDocument());
|
||||||
|
d->mainWidget->initialize();
|
||||||
|
|
||||||
data->documentManager.setCurrentDesignDocument(Core::EditorManager::currentEditor());
|
if (d->documentManager.hasCurrentDesignDocument()) {
|
||||||
|
|
||||||
data->shortCutManager.connectUndoActions(currentDesignDocument());
|
|
||||||
|
|
||||||
data->mainWidget->initialize();
|
|
||||||
|
|
||||||
if (data->documentManager.hasCurrentDesignDocument()) {
|
|
||||||
activateAutoSynchronization();
|
activateAutoSynchronization();
|
||||||
data->shortCutManager.updateActions(currentDesignDocument()->textEditor());
|
d->shortCutManager.updateActions(currentDesignDocument()->textEditor());
|
||||||
data->viewManager.pushFileOnCrumbleBar(data->documentManager.currentDesignDocument()->fileName().fileName());
|
d->viewManager.pushFileOnCrumbleBar(d->documentManager.currentDesignDocument()->fileName().fileName());
|
||||||
}
|
}
|
||||||
|
|
||||||
data->shortCutManager.updateUndoActions(currentDesignDocument());
|
d->shortCutManager.updateUndoActions(currentDesignDocument());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlDesignerPlugin::hideDesigner()
|
void QmlDesignerPlugin::hideDesigner()
|
||||||
@@ -236,41 +288,35 @@ void QmlDesignerPlugin::hideDesigner()
|
|||||||
&& !currentDesignDocument()->hasQmlParseErrors())
|
&& !currentDesignDocument()->hasQmlParseErrors())
|
||||||
jumpTextCursorToSelectedModelNode();
|
jumpTextCursorToSelectedModelNode();
|
||||||
|
|
||||||
|
if (d->documentManager.hasCurrentDesignDocument()) {
|
||||||
if (data->documentManager.hasCurrentDesignDocument()) {
|
|
||||||
deactivateAutoSynchronization();
|
deactivateAutoSynchronization();
|
||||||
data->mainWidget->saveSettings();
|
d->mainWidget->saveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
data->shortCutManager.disconnectUndoActions(currentDesignDocument());
|
d->shortCutManager.disconnectUndoActions(currentDesignDocument());
|
||||||
|
d->documentManager.setCurrentDesignDocument(nullptr);
|
||||||
data->documentManager.setCurrentDesignDocument(0);
|
d->shortCutManager.updateUndoActions(nullptr);
|
||||||
|
|
||||||
data->shortCutManager.updateUndoActions(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlDesignerPlugin::changeEditor()
|
void QmlDesignerPlugin::changeEditor()
|
||||||
{
|
{
|
||||||
if (data->documentManager.hasCurrentDesignDocument()) {
|
if (d->documentManager.hasCurrentDesignDocument()) {
|
||||||
deactivateAutoSynchronization();
|
deactivateAutoSynchronization();
|
||||||
data->mainWidget->saveSettings();
|
d->mainWidget->saveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
data->shortCutManager.disconnectUndoActions(currentDesignDocument());
|
d->shortCutManager.disconnectUndoActions(currentDesignDocument());
|
||||||
|
d->documentManager.setCurrentDesignDocument(Core::EditorManager::currentEditor());
|
||||||
|
d->mainWidget->initialize();
|
||||||
|
d->shortCutManager.connectUndoActions(currentDesignDocument());
|
||||||
|
|
||||||
data->documentManager.setCurrentDesignDocument(Core::EditorManager::currentEditor());
|
if (d->documentManager.hasCurrentDesignDocument()) {
|
||||||
|
|
||||||
data->mainWidget->initialize();
|
|
||||||
|
|
||||||
data->shortCutManager.connectUndoActions(currentDesignDocument());
|
|
||||||
|
|
||||||
if (data->documentManager.hasCurrentDesignDocument()) {
|
|
||||||
activateAutoSynchronization();
|
activateAutoSynchronization();
|
||||||
data->viewManager.pushFileOnCrumbleBar(data->documentManager.currentDesignDocument()->fileName().fileName());
|
d->viewManager.pushFileOnCrumbleBar(d->documentManager.currentDesignDocument()->fileName().fileName());
|
||||||
data->viewManager.setComponentViewToMaster();
|
d->viewManager.setComponentViewToMaster();
|
||||||
}
|
}
|
||||||
|
|
||||||
data->shortCutManager.updateUndoActions(currentDesignDocument());
|
d->shortCutManager.updateUndoActions(currentDesignDocument());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlDesignerPlugin::jumpTextCursorToSelectedModelNode()
|
void QmlDesignerPlugin::jumpTextCursorToSelectedModelNode()
|
||||||
@@ -283,8 +329,8 @@ void QmlDesignerPlugin::jumpTextCursorToSelectedModelNode()
|
|||||||
if (selectedNode.isValid()) {
|
if (selectedNode.isValid()) {
|
||||||
const int nodeOffset = rewriterView()->nodeOffset(selectedNode);
|
const int nodeOffset = rewriterView()->nodeOffset(selectedNode);
|
||||||
if (nodeOffset > 0) {
|
if (nodeOffset > 0) {
|
||||||
const ModelNode currentSelectedNode
|
const ModelNode currentSelectedNode = rewriterView()->
|
||||||
= rewriterView()->nodeAtTextCursorPosition(currentDesignDocument()->plainTextEdit()->textCursor().position());
|
nodeAtTextCursorPosition(currentDesignDocument()->plainTextEdit()->textCursor().position());
|
||||||
if (currentSelectedNode != selectedNode) {
|
if (currentSelectedNode != selectedNode) {
|
||||||
int line, column;
|
int line, column;
|
||||||
currentDesignDocument()->textEditor()->convertPosition(nodeOffset, &line, &column);
|
currentDesignDocument()->textEditor()->convertPosition(nodeOffset, &line, &column);
|
||||||
@@ -319,19 +365,17 @@ void QmlDesignerPlugin::activateAutoSynchronization()
|
|||||||
QList<RewriterError> errors = currentDesignDocument()->qmlParseErrors();
|
QList<RewriterError> errors = currentDesignDocument()->qmlParseErrors();
|
||||||
if (errors.isEmpty()) {
|
if (errors.isEmpty()) {
|
||||||
selectModelNodeUnderTextCursor();
|
selectModelNodeUnderTextCursor();
|
||||||
data->mainWidget->enableWidgets();
|
d->mainWidget->enableWidgets();
|
||||||
data->mainWidget->setupNavigatorHistory(currentDesignDocument()->textEditor());
|
d->mainWidget->setupNavigatorHistory(currentDesignDocument()->textEditor());
|
||||||
} else {
|
} else {
|
||||||
data->mainWidget->disableWidgets();
|
d->mainWidget->disableWidgets();
|
||||||
data->mainWidget->showErrorMessage(errors);
|
d->mainWidget->showMessageBox(errors + currentDesignDocument()->qmlParseWarnings());
|
||||||
}
|
}
|
||||||
|
|
||||||
currentDesignDocument()->updateSubcomponentManager();
|
currentDesignDocument()->updateSubcomponentManager();
|
||||||
|
|
||||||
connect(rewriterView(),
|
d->rewriterErrorConnection = connect(rewriterView(), &RewriterView::errorsChanged,
|
||||||
SIGNAL(errorsChanged(QList<RewriterError>)),
|
d->mainWidget, &Internal::DesignModeWidget::updateErrorStatus);
|
||||||
data->mainWidget,
|
|
||||||
SLOT(updateErrorStatus(QList<RewriterError>)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlDesignerPlugin::deactivateAutoSynchronization()
|
void QmlDesignerPlugin::deactivateAutoSynchronization()
|
||||||
@@ -341,11 +385,7 @@ void QmlDesignerPlugin::deactivateAutoSynchronization()
|
|||||||
viewManager().detachRewriterView();
|
viewManager().detachRewriterView();
|
||||||
documentManager().currentDesignDocument()->resetToDocumentModel();
|
documentManager().currentDesignDocument()->resetToDocumentModel();
|
||||||
|
|
||||||
disconnect(rewriterView(),
|
disconnect(d->rewriterErrorConnection);
|
||||||
SIGNAL(errorsChanged(QList<RewriterError>)),
|
|
||||||
data->mainWidget,
|
|
||||||
SLOT(updateErrorStatus(QList<RewriterError>)));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlDesignerPlugin::resetModelSelection()
|
void QmlDesignerPlugin::resetModelSelection()
|
||||||
@@ -364,94 +404,27 @@ Model *QmlDesignerPlugin::currentModel() const
|
|||||||
return currentDesignDocument()->currentModel();
|
return currentDesignDocument()->currentModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool checkIfEditorIsQtQuick(Core::IEditor *editor)
|
|
||||||
{
|
|
||||||
if (editor)
|
|
||||||
if (editor && editor->document()->id() == QmlJSEditor::Constants::C_QMLJSEDITOR_ID) {
|
|
||||||
QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
|
|
||||||
QmlJS::Document::Ptr document = modelManager->ensuredGetDocumentForPath(editor->document()->filePath().toString());
|
|
||||||
if (!document.isNull())
|
|
||||||
return document->language() == QmlJS::Dialect::QmlQtQuick1
|
|
||||||
|| document->language() == QmlJS::Dialect::QmlQtQuick2
|
|
||||||
|| document->language() == QmlJS::Dialect::QmlQtQuick2Ui
|
|
||||||
|| document->language() == QmlJS::Dialect::Qml;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmlDesignerPlugin::onCurrentEditorChanged(Core::IEditor *editor)
|
|
||||||
{
|
|
||||||
if (data
|
|
||||||
&& checkIfEditorIsQtQuick(editor)
|
|
||||||
&& isInDesignerMode())
|
|
||||||
{
|
|
||||||
data->shortCutManager.updateActions(editor);
|
|
||||||
changeEditor();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool isDesignerMode(Core::Id mode)
|
|
||||||
{
|
|
||||||
return mode == Core::DesignMode::instance()->id();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static bool documentIsAlreadyOpen(DesignDocument *designDocument, Core::IEditor *editor, Core::Id newMode)
|
|
||||||
{
|
|
||||||
return designDocument
|
|
||||||
&& editor == designDocument->editor()
|
|
||||||
&& isDesignerMode(newMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmlDesignerPlugin::onCurrentModeChanged(Core::Id newMode, Core::Id oldMode)
|
|
||||||
{
|
|
||||||
if (data
|
|
||||||
&& Core::EditorManager::currentEditor()
|
|
||||||
&& checkIfEditorIsQtQuick(Core::EditorManager::currentEditor())
|
|
||||||
&& !documentIsAlreadyOpen(currentDesignDocument(), Core::EditorManager::currentEditor(), newMode)) {
|
|
||||||
|
|
||||||
if (!isDesignerMode(newMode) && isDesignerMode(oldMode))
|
|
||||||
hideDesigner();
|
|
||||||
else if (Core::EditorManager::currentEditor()
|
|
||||||
&& isDesignerMode(newMode))
|
|
||||||
showDesigner();
|
|
||||||
else if (currentDesignDocument())
|
|
||||||
hideDesigner();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DesignDocument *QmlDesignerPlugin::currentDesignDocument() const
|
DesignDocument *QmlDesignerPlugin::currentDesignDocument() const
|
||||||
{
|
{
|
||||||
if (data)
|
if (d)
|
||||||
return data->documentManager.currentDesignDocument();
|
return d->documentManager.currentDesignDocument();
|
||||||
|
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Internal::DesignModeWidget *QmlDesignerPlugin::mainWidget() const
|
Internal::DesignModeWidget *QmlDesignerPlugin::mainWidget() const
|
||||||
{
|
{
|
||||||
if (data)
|
if (d)
|
||||||
return data->mainWidget;
|
return d->mainWidget;
|
||||||
|
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlDesignerPlugin::switchToTextModeDeferred()
|
void QmlDesignerPlugin::switchToTextModeDeferred()
|
||||||
{
|
{
|
||||||
QTimer::singleShot(0, this, SLOT(switschToTextMode()));
|
QTimer::singleShot(0, this, [] () {
|
||||||
}
|
Core::ModeManager::activateMode(Core::Constants::MODE_EDIT);
|
||||||
|
});
|
||||||
void QmlDesignerPlugin::onTextEditorsClosed(QList<Core::IEditor*> editors)
|
|
||||||
{
|
|
||||||
if (data) {
|
|
||||||
if (data->documentManager.hasCurrentDesignDocument()
|
|
||||||
&& editors.contains(data->documentManager.currentDesignDocument()->textEditor()))
|
|
||||||
hideDesigner();
|
|
||||||
|
|
||||||
data->documentManager.removeEditors(editors);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlDesignerPlugin *QmlDesignerPlugin::instance()
|
QmlDesignerPlugin *QmlDesignerPlugin::instance()
|
||||||
@@ -461,61 +434,45 @@ QmlDesignerPlugin *QmlDesignerPlugin::instance()
|
|||||||
|
|
||||||
DocumentManager &QmlDesignerPlugin::documentManager()
|
DocumentManager &QmlDesignerPlugin::documentManager()
|
||||||
{
|
{
|
||||||
return data->documentManager;
|
return d->documentManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DocumentManager &QmlDesignerPlugin::documentManager() const
|
const DocumentManager &QmlDesignerPlugin::documentManager() const
|
||||||
{
|
{
|
||||||
return data->documentManager;
|
return d->documentManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewManager &QmlDesignerPlugin::viewManager()
|
ViewManager &QmlDesignerPlugin::viewManager()
|
||||||
{
|
{
|
||||||
return data->viewManager;
|
return d->viewManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ViewManager &QmlDesignerPlugin::viewManager() const
|
const ViewManager &QmlDesignerPlugin::viewManager() const
|
||||||
{
|
{
|
||||||
return data->viewManager;
|
return d->viewManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
DesignerActionManager &QmlDesignerPlugin::designerActionManager()
|
DesignerActionManager &QmlDesignerPlugin::designerActionManager()
|
||||||
{
|
{
|
||||||
return data->viewManager.designerActionManager();
|
return d->viewManager.designerActionManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
const DesignerActionManager &QmlDesignerPlugin::designerActionManager() const
|
const DesignerActionManager &QmlDesignerPlugin::designerActionManager() const
|
||||||
{
|
{
|
||||||
return data->viewManager.designerActionManager();
|
return d->viewManager.designerActionManager();
|
||||||
}
|
|
||||||
|
|
||||||
void QmlDesignerPlugin::switchTextDesign()
|
|
||||||
{
|
|
||||||
if (Core::ModeManager::currentMode() == Core::Constants::MODE_EDIT) {
|
|
||||||
Core::IEditor *editor = Core::EditorManager::currentEditor();
|
|
||||||
if (checkIfEditorIsQtQuick(editor))
|
|
||||||
Core::ModeManager::activateMode(Core::Constants::MODE_DESIGN);
|
|
||||||
} else if (Core::ModeManager::currentMode() == Core::Constants::MODE_DESIGN) {
|
|
||||||
Core::ModeManager::activateMode(Core::Constants::MODE_EDIT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmlDesignerPlugin::switschToTextMode()
|
|
||||||
{
|
|
||||||
Core::ModeManager::activateMode(Core::Constants::MODE_EDIT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DesignerSettings QmlDesignerPlugin::settings()
|
DesignerSettings QmlDesignerPlugin::settings()
|
||||||
{
|
{
|
||||||
data->settings.fromSettings(Core::ICore::settings());
|
d->settings.fromSettings(Core::ICore::settings());
|
||||||
return data->settings;
|
return d->settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlDesignerPlugin::setSettings(const DesignerSettings &s)
|
void QmlDesignerPlugin::setSettings(const DesignerSettings &s)
|
||||||
{
|
{
|
||||||
if (s != data->settings) {
|
if (s != d->settings) {
|
||||||
data->settings = s;
|
d->settings = s;
|
||||||
data->settings.toSettings(Core::ICore::settings());
|
d->settings.toSettings(Core::ICore::settings());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -48,7 +48,7 @@ namespace Core {
|
|||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
class QmlDesignerPluginData;
|
class QmlDesignerPluginPrivate;
|
||||||
|
|
||||||
namespace Internal { class DesignModeWidget; }
|
namespace Internal { class DesignModeWidget; }
|
||||||
|
|
||||||
@@ -84,13 +84,6 @@ public:
|
|||||||
|
|
||||||
void switchToTextModeDeferred();
|
void switchToTextModeDeferred();
|
||||||
|
|
||||||
private slots:
|
|
||||||
void switchTextDesign();
|
|
||||||
void switschToTextMode();
|
|
||||||
void onTextEditorsClosed(QList<Core::IEditor *> editors);
|
|
||||||
void onCurrentEditorChanged(Core::IEditor *editor);
|
|
||||||
void onCurrentModeChanged(Core::Id mode, Core::Id oldMode);
|
|
||||||
|
|
||||||
private: // functions
|
private: // functions
|
||||||
void createDesignModeWidget();
|
void createDesignModeWidget();
|
||||||
void showDesigner();
|
void showDesigner();
|
||||||
@@ -105,7 +98,7 @@ private: // functions
|
|||||||
Model *currentModel() const;
|
Model *currentModel() const;
|
||||||
|
|
||||||
private: // variables
|
private: // variables
|
||||||
QmlDesignerPluginData *data;
|
QmlDesignerPluginPrivate *d = nullptr;
|
||||||
static QmlDesignerPlugin *m_instance;
|
static QmlDesignerPlugin *m_instance;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user