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
670d2412
Commit
670d2412
authored
May 09, 2011
by
Christiaan Janssen
Browse files
QmlLivePreview: adding animations and transitions
Reviewed-by: Kai Koehne
parent
09a78a3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver.cpp
View file @
670d2412
...
...
@@ -422,6 +422,7 @@ void QDeclarativeViewObserverPrivate::_q_createQmlObject(const QString &qml, QOb
if
(
newObject
)
{
newObject
->
setParent
(
parent
);
do
{
// add child item
QDeclarativeItem
*
parentItem
=
qobject_cast
<
QDeclarativeItem
*>
(
parent
);
QDeclarativeItem
*
newItem
=
qobject_cast
<
QDeclarativeItem
*>
(
newObject
);
if
(
parentItem
&&
newItem
)
{
...
...
@@ -429,6 +430,7 @@ void QDeclarativeViewObserverPrivate::_q_createQmlObject(const QString &qml, QOb
break
;
}
// add property change
QDeclarativeState
*
parentState
=
qobject_cast
<
QDeclarativeState
*>
(
parent
);
QDeclarativeStateOperation
*
newPropertyChanges
=
qobject_cast
<
QDeclarativeStateOperation
*>
(
newObject
);
if
(
parentState
&&
newPropertyChanges
)
{
...
...
@@ -436,12 +438,39 @@ void QDeclarativeViewObserverPrivate::_q_createQmlObject(const QString &qml, QOb
break
;
}
// add states
QDeclarativeState
*
newState
=
qobject_cast
<
QDeclarativeState
*>
(
newObject
);
if
(
parentItem
&&
newState
)
{
QDeclarativeListReference
statesList
(
parentItem
,
"states"
);
statesList
.
append
(
newObject
);
break
;
}
// add animation to transition
if
(
parent
->
inherits
(
"QDeclarativeTransition"
)
&&
newObject
->
inherits
(
"QDeclarativeAbstractAnimation"
))
{
QDeclarativeListReference
animationsList
(
parent
,
"animations"
);
animationsList
.
append
(
newObject
);
break
;
}
// add animation to animation
if
(
parent
->
inherits
(
"QDeclarativeAnimationGroup"
)
&&
newObject
->
inherits
(
"QDeclarativeAbstractAnimation"
))
{
QDeclarativeListReference
animationsList
(
parent
,
"animations"
);
animationsList
.
append
(
newObject
);
break
;
}
// add transition
if
(
parentItem
&&
newObject
->
inherits
(
"QDeclarativeTransition"
))
{
QDeclarativeListReference
transitionsList
(
parentItem
,
"transitions"
);
if
(
transitionsList
.
count
()
==
1
&&
transitionsList
.
at
(
0
)
==
0
)
transitionsList
.
clear
();
transitionsList
.
append
(
newObject
);
break
;
}
}
while
(
false
);
}
}
...
...
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