Commit 9ee73a4f authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner: Add support for .ui.qml

Change-Id: Iec0663147a9072d8332cf05ad56bcb7db0253eda
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@digia.com>
parent 685bc9f0
......@@ -68,7 +68,8 @@ static inline QStringList supportedVersionsList()
QStringList list;
list << QStringLiteral("1.0") << QStringLiteral("1.1")
<< QStringLiteral("2.0") << QStringLiteral("2.1")
<< QStringLiteral("2.2") << QStringLiteral("2.3");
<< QStringLiteral("2.2") << QStringLiteral("2.3")
<< QStringLiteral("2.4");
return list;
}
......@@ -842,7 +843,13 @@ bool TextToModelMerger::load(const QString &data, DifferenceHandler &differenceH
try {
Snapshot snapshot = m_rewriterView->textModifier()->qmljsSnapshot();
const QString fileName = url.toLocalFile();
Document::MutablePtr doc = Document::create(fileName.isEmpty() ? QStringLiteral("<internal>") : fileName, Dialect::Qml);
Dialect dialect = ModelManagerInterface::guessLanguageOfFile(fileName);
if (dialect == Dialect::AnyLanguage
|| dialect == Dialect::NoLanguage)
dialect = Dialect::Qml;
Document::MutablePtr doc = Document::create(fileName.isEmpty() ? QStringLiteral("<internal>") : fileName, dialect);
doc->setSource(data);
doc->parseQml();
......
......@@ -37,6 +37,8 @@
#include <qmljseditor/qmljseditorconstants.h>
#include <qmljstools/qmljstoolsconstants.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/designmode.h>
......@@ -154,7 +156,8 @@ bool QmlDesignerPlugin::initialize(const QStringList & /*arguments*/, QString *e
void QmlDesignerPlugin::extensionsInitialized()
{
QStringList mimeTypes;
mimeTypes.append("application/x-qml");
mimeTypes.append(QmlJSTools::Constants::QML_MIMETYPE);
mimeTypes.append(QmlJSTools::Constants::QMLUI_MIMETYPE);
Core::DesignMode::instance()->registerDesignWidget(data->mainWidget, mimeTypes, data->context->context());
connect(Core::DesignMode::instance(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment