Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
4b863d55
Commit
4b863d55
authored
Jul 21, 2010
by
Thomas Hartmann
Browse files
QmlJS.propertyReader: check for bindings in gradients
parent
50875ff0
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/libs/qmljs/qmljspropertyreader.cpp
View file @
4b863d55
...
...
@@ -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
));
}
}
...
...
src/libs/qmljs/qmljspropertyreader.h
View file @
4b863d55
...
...
@@ -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
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment