forked from qt-creator/qt-creator
Qt Quick: Separate Qt Quick Designer and QMLJS editor factories
Currently the QmlJSEditorFactory hardcodes that .qml.ui files are opened "in Design mode", without any option to explicitly open them directly in text mode. While this is the preferred way of working, there are always exceptions. Separate the "Edit mode by default" and the "Design mode by default" parts into separate editor factories. The former one is the default editor for .qml files, the latter for .qml.ui files. This allows users to explicitly choose "Open With > QML JS Editor" to open .qml.ui files directly in Edit mode. Fixes: QTCREATORBUG-18123 Change-Id: I72ab2d25fdc538210123782f6611f9c6e3157dea Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -136,6 +136,7 @@ class QMLJSEDITOR_EXPORT QmlJSEditor : public TextEditor::BaseTextEditor
|
||||
public:
|
||||
QmlJSEditor();
|
||||
|
||||
QmlJSEditorDocument *qmlJSDocument() const;
|
||||
bool isDesignModePreferred() const override;
|
||||
};
|
||||
|
||||
@@ -145,6 +146,7 @@ class QMLJSEDITOR_EXPORT QmlJSEditorFactory : public TextEditor::TextEditorFacto
|
||||
|
||||
public:
|
||||
QmlJSEditorFactory();
|
||||
QmlJSEditorFactory(Core::Id id);
|
||||
|
||||
static void decorateEditor(TextEditor::TextEditorWidget *editor);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user