summaryrefslogtreecommitdiff
path: root/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@digia.com>2013-04-10 10:14:28 +0200
committerThomas Hartmann <Thomas.Hartmann@digia.com>2013-04-10 15:19:43 +0200
commitf8c23cf4d05dd8f7faf631afdf36fecde2d3b937 (patch)
tree6a50001fd7398e728e607b003990a48b6630b0cb /src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp
parent3ed0a4b77f3af770409f26553d0f380edd05f351 (diff)
downloadqt-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.cpp9
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(';'));