Skip to content
GitLab
Menu
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
11b93e8f
Commit
11b93e8f
authored
Apr 27, 2010
by
Marco Bubke
Committed by
Kai Koehne
Apr 27, 2010
Browse files
Fix crash for setting a expression.
Reviewed-by: kkoehne
parent
bc26b917
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/core/instances/qmlpropertychangesnodeinstance.cpp
View file @
11b93e8f
...
...
@@ -85,24 +85,33 @@ QObject *QmlPropertyChangesObject::targetObject() const
void
QmlPropertyChangesObject
::
setTargetObject
(
QObject
*
object
)
{
QMutableListIterator
<
QDeclarativeAction
>
actionIterator
(
m_qmlActionList
);
while
(
actionIterator
.
hasNext
())
{
QDeclarativeAction
&
qmlAction
=
actionIterator
.
next
();
if
(
m_expressionHash
.
contains
(
qmlAction
.
specifiedProperty
)
&&
m_expressionHash
[
qmlAction
.
specifiedProperty
].
second
)
{
if
(
isActive
())
{
QDeclarativePropertyPrivate
::
setBinding
(
qmlAction
.
property
,
0
,
QDeclarativePropertyPrivate
::
DontRemoveBinding
|
QDeclarativePropertyPrivate
::
BypassInterceptor
);
qmlAction
.
property
.
write
(
qmlAction
.
fromValue
);
}
m_expressionHash
[
qmlAction
.
specifiedProperty
].
second
.
data
()
->
destroy
();
qmlAction
.
toBinding
=
0
;
}
if
(
isActive
()
&&
targetObject
())
{
updateRevertValueAndBinding
(
qmlAction
.
specifiedProperty
);
}
}
m_targetObject
=
object
;
QMutableListIterator
<
QDeclarativeAction
>
actionIterator
(
m_qmlActionList
);
actionIterator
.
toFront
(
);
while
(
actionIterator
.
hasNext
())
{
QDeclarativeAction
&
qmlAction
=
actionIterator
.
next
();
qmlAction
.
specifiedObject
=
object
;
qmlAction
.
property
=
createMetaProperty
(
qmlAction
.
specifiedProperty
);
qmlAction
.
fromValue
=
qmlAction
.
property
.
read
();
qmlAction
.
fromBinding
=
QDeclarativePropertyPrivate
::
binding
(
qmlAction
.
property
);
if
(
m_expressionHash
.
contains
(
qmlAction
.
specifiedProperty
)
&&
m_expressionHash
[
qmlAction
.
specifiedProperty
].
second
)
{
if
(
isActive
())
{
QDeclarativePropertyPrivate
::
setBinding
(
qmlAction
.
property
,
0
,
QDeclarativePropertyPrivate
::
DontRemoveBinding
|
QDeclarativePropertyPrivate
::
BypassInterceptor
);
qmlAction
.
property
.
write
(
qmlAction
.
fromValue
);
}
m_expressionHash
[
qmlAction
.
specifiedProperty
].
second
.
data
()
->
destroy
();
qmlAction
.
toBinding
=
0
;
}
if
(
m_expressionHash
.
contains
(
qmlAction
.
specifiedProperty
)
&&
targetObject
())
{
QDeclarativeBinding
*
binding
=
new
QDeclarativeBinding
(
m_expressionHash
[
qmlAction
.
specifiedProperty
].
first
,
targetObject
(),
QDeclarativeEngine
::
contextForObject
(
targetObject
()));
...
...
@@ -443,6 +452,7 @@ void QmlPropertyChangesObject::setExpression(const QString &name, const QString
if
(
QDeclarativePropertyPrivate
::
binding
(
metaProperty
)
==
m_expressionHash
[
name
].
second
.
data
())
QDeclarativePropertyPrivate
::
setBinding
(
metaProperty
,
0
,
QDeclarativePropertyPrivate
::
BypassInterceptor
|
QDeclarativePropertyPrivate
::
DontRemoveBinding
);
m_expressionHash
.
take
(
name
).
second
->
destroy
();
qmlAction
.
toBinding
=
0
;
}
...
...
@@ -457,7 +467,7 @@ void QmlPropertyChangesObject::setExpression(const QString &name, const QString
}
updateRevertValueAndBinding
(
name
);
if
(
isActive
())
if
(
isActive
()
&&
binding
)
QDeclarativePropertyPrivate
::
setBinding
(
metaProperty
,
binding
,
QDeclarativePropertyPrivate
::
BypassInterceptor
|
QDeclarativePropertyPrivate
::
DontRemoveBinding
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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