Commit 4b863d55 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlJS.propertyReader: check for bindings in gradients

parent 50875ff0
......@@ -239,11 +239,13 @@ PropertyReader::PropertyReader(Document::Ptr doc, AST::UiObjectInitializer *ast)
}
}
QLinearGradient PropertyReader::parseGradient(const QString &propertyName) const
QLinearGradient PropertyReader::parseGradient(const QString &propertyName, bool *isBound) const
{
if (!m_doc)
return QLinearGradient();
*isBound = false;
for (UiObjectMemberList *members = m_ast->members; members; members = members->next) {
UiObjectMember *member = members->member;
......@@ -265,6 +267,8 @@ QLinearGradient PropertyReader::parseGradient(const QString &propertyName) const
if (localParser.hasProperty("color") && localParser.hasProperty("position")) {
QColor color = localParser.readProperty("color").value<QColor>();
qreal position = localParser.readProperty("position").toReal();
if (localParser.isBindingOrEnum("color") || localParser.isBindingOrEnum("position"))
*isBound = true;
stops.append( QPair<qreal, QColor>(position, color));
}
}
......
......@@ -62,7 +62,7 @@ public:
return QVariant();
}
QLinearGradient parseGradient(const QString &propertyName) const;
QLinearGradient parseGradient(const QString &propertyName, bool *isBound) const;
QStringList properties() const
{ return m_properties.keys(); }
......
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