PDA

View Full Version : Problem with property bool



qba10
12th February 2011, 22:19
Hi
This is my code:


import Qt 4.7

Item {

width: 180
height: 60
id: root

property bool collapsedButton: true
(...)
ParallelAnimation {
running:root.collapsedButton
NumberAnimation { target: backgroundCallapsed; property: "width"; to: 64 ;}
NumberAnimation { target: background; property: "opacity"; to: 0 }
NumberAnimation { target: text; property: "opacity"; to: 0 }

}
(...)

Thie code does not work, but when I change "root.collapsedButton" form running to "true" this script work

wysota
13th February 2011, 01:03
Define what "does not work" mean. Do you get any errors at the console?

qba10
13th February 2011, 21:38
Aniamtion don't run. Console is empty. Variable "collapsedButton" contains value "true", but animation don't start.
I tried this:


import Qt 4.7

Item {

width: 180
height: 60
id: root

property bool collapsedButton: true
(...)
ParallelAnimation {
running:{
if(root.collapsedButton == true){
true
}else{
false
}
NumberAnimation { target: backgroundCallapsed; property: "width"; to: 64 ;}
NumberAnimation { target: background; property: "opacity"; to: 0 }
NumberAnimation { target: text; property: "opacity"; to: 0 }

}
(...)

but aniamtion don't start too.