forked from qt-creator/qt-creator
Design mode: Give IEditor a 'preferred mode'.
... and switch to it in EditorManager::activateEditor. There no longer is a need for special currentEditorChanged() handling in the editor that use a special mode. QmlDesigner receives an additional setting specifying the desired edit mode. QmlJSEditor detects whether QmlDesigner is present by checking the registered mimetypes of the Design mode and retrieves the settings via keys. Remove some obsolete code and clean up includes on qmldesignerconstants.h Reviewed-by: con
This commit is contained in:
@@ -127,6 +127,14 @@ QString DesignMode::id() const
|
||||
return QLatin1String(Constants::MODE_DESIGN);
|
||||
}
|
||||
|
||||
QStringList DesignMode::registeredMimeTypes() const
|
||||
{
|
||||
QStringList rc;
|
||||
foreach(const DesignEditorInfo *i, m_editors)
|
||||
rc += i->mimeTypes;
|
||||
return rc;
|
||||
}
|
||||
|
||||
void DesignMode::registerDesignWidget(QWidget *widget, const QStringList &mimeTypes, bool preferDesignMode)
|
||||
{
|
||||
int index = m_stackWidget->addWidget(widget);
|
||||
|
||||
Reference in New Issue
Block a user