diff options
author | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2013-10-23 17:44:19 +0200 |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2013-10-23 17:45:31 +0200 |
commit | 120d56c116ffb3b0de2946c17616c475ed7708c9 (patch) | |
tree | ae521adb3c5349aaae1a13672ccc78e5a5cff009 /src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp | |
parent | c0cae37d6aaa01df71223dba0ae66c4760cc83a8 (diff) | |
download | qt-creator-120d56c116ffb3b0de2946c17616c475ed7708c9.tar.gz |
QmlDesigner.PropertyEditor: bringing back the templates
Template for auto generates pages now work with in Qt Quick 2.
Change-Id: Idd0a8fe8d82555bc69b192b21df7641dcdb634b4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Diffstat (limited to 'src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp')
-rw-r--r-- | src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp index 37fa5bc6df..05b2511778 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp @@ -129,7 +129,7 @@ PropertyEditorQmlBackend::PropertyEditorQmlBackend(PropertyEditorView *propertyE m_dummyPropertyEditorValue->setValue("#000000"); context()->setContextProperty("dummyBackendValue", m_dummyPropertyEditorValue.data()); m_contextObject->setBackendValues(&m_backendValuesPropertyMap); - context()->setContextObject(m_contextObject.data()); + m_contextObject->insertInQmlContext(context()); QObject::connect(&m_backendValuesPropertyMap, SIGNAL(valueChanged(QString,QVariant)), propertyEditor, SLOT(changeValue(QString))); } @@ -352,9 +352,9 @@ QString PropertyEditorQmlBackend::templateGeneration(NodeMetaInfo type, QStringList imports = variantToStringList(templateConfiguration()->property(QLatin1String("imports"))); QString qmlTemplate = imports.join(QLatin1String("\n")) + QLatin1Char('\n'); - qmlTemplate += QLatin1String("GroupBox {\n"); + qmlTemplate += QLatin1String("Section {\n"); qmlTemplate += QString(QLatin1String("caption: \"%1\"\n")).arg(QString::fromUtf8(objectNode.modelNode().simplifiedTypeName())); - qmlTemplate += QLatin1String("layout: VerticalLayout {\n"); + qmlTemplate += QLatin1String("SectionLayout {\n"); QList<PropertyName> orderedList = type.propertyNames(); qSort(orderedList); @@ -390,8 +390,8 @@ QString PropertyEditorQmlBackend::templateGeneration(NodeMetaInfo type, } } } - qmlTemplate += QLatin1String("}\n"); //VerticalLayout - qmlTemplate += QLatin1String("}\n"); //GroupBox + qmlTemplate += QLatin1String("}\n"); //Section + qmlTemplate += QLatin1String("}\n"); //SectionLayout if (emptyTemplate) return QString(); |