diff options
author | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2013-04-10 10:14:28 +0200 |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2013-04-10 15:19:43 +0200 |
commit | f8c23cf4d05dd8f7faf631afdf36fecde2d3b937 (patch) | |
tree | 6a50001fd7398e728e607b003990a48b6630b0cb /src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp | |
parent | 3ed0a4b77f3af770409f26553d0f380edd05f351 (diff) | |
download | qt-creator-f8c23cf4d05dd8f7faf631afdf36fecde2d3b937.tar.gz |
QmlDesigner.Rewriter: Fixing dynamic properties
Dynamic properties were not properly rewritten.
Change-Id: Icf2bdd41104aaaeb0473f0616958752dcb19fdb4
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
Diffstat (limited to 'src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp')
-rw-r--r-- | src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp b/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp index df647e181f..37af895cea 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp +++ b/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp @@ -42,13 +42,15 @@ AddPropertyVisitor::AddPropertyVisitor(QmlDesigner::TextModifier &modifier, const QmlDesigner::PropertyName &name, const QString &value, QmlRefactoring::PropertyType propertyType, - const PropertyNameList &propertyOrder): + const PropertyNameList &propertyOrder, + const QmlDesigner::TypeName &dynamicTypeName) : QMLRewriter(modifier), m_parentLocation(parentLocation), m_name(name), m_value(value), m_propertyType(propertyType), - m_propertyOrder(propertyOrder) + m_propertyOrder(propertyOrder), + m_dynamicTypeName(dynamicTypeName) { } @@ -147,6 +149,9 @@ void AddPropertyVisitor::addInMembers(QmlJS::AST::UiObjectInitializer *initializ Q_ASSERT(!"unknown property type"); } + if (!m_dynamicTypeName.isEmpty()) + newPropertyTemplate.prepend(QString(QLatin1String("property %1 ")).arg(QString::fromUtf8(m_dynamicTypeName))); + if (isOneLiner) { if (needsPreceedingSemicolon) newPropertyTemplate.prepend(QLatin1Char(';')); |