Commit 0aa863e9 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.documentController: fixing toText for alias imports

parent 4cbdc3b4
...@@ -159,6 +159,7 @@ void DesignDocumentControllerView::fromClipboard() ...@@ -159,6 +159,7 @@ void DesignDocumentControllerView::fromClipboard()
QString DesignDocumentControllerView::toText() const QString DesignDocumentControllerView::toText() const
{ {
QScopedPointer<Model> outputModel(Model::create("QtQuick.Rectangle", 1, 0, model())); QScopedPointer<Model> outputModel(Model::create("QtQuick.Rectangle", 1, 0, model()));
outputModel->setFileUrl(model()->fileUrl());
QPlainTextEdit textEdit; QPlainTextEdit textEdit;
QString imports; QString imports;
...@@ -194,7 +195,7 @@ void DesignDocumentControllerView::fromText(QString text) ...@@ -194,7 +195,7 @@ void DesignDocumentControllerView::fromText(QString text)
QPlainTextEdit textEdit; QPlainTextEdit textEdit;
QString imports; QString imports;
foreach (const Import &import, model()->imports()) foreach (const Import &import, model()->imports())
imports += import.toString() + ";\n"; imports += import.toString(true, true) + "\n";
textEdit.setPlainText(imports + text); textEdit.setPlainText(imports + text);
NotIndentingTextEditModifier modifier(&textEdit); NotIndentingTextEditModifier modifier(&textEdit);
......
Supports Markdown
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