Hello
I am facing a strange issue with trapping key events when animations are
active in the background
Below is my code
The animations happen as expected. Mouse click works on the enter btn .
However there are no key events trapped. I don't even get the console.log
message .
import Qt 4.7
FocusScope{
id:welcomeScreen
anchors.fill:parent
property int waitDuration:4000
property int animDuration:1000
property int activeLang:0
SequentialAnimation{
id:welcomeAnimation
running:false
NumberAnimation { target: welcOne; property: 'opacity';from:0;
to:1; duration:animDuration}
SequentialAnimation{
loops:Animation.Infinite
NumberAnimation { target: welcTwo; property:
'opacity';from:0; to:1; duration:animDuration}
NumberAnimation { target: welcOne; property:
'opacity';from:1; to:0; duration:0}
PauseAnimation { duration: waitDuration }
NumberAnimation { target: welcThree; property:
'opacity';from:0; to:1; duration:animDuration}
NumberAnimation { target: welcTwo; property:
'opacity';from:1; to:0; duration:0}
PauseAnimation { duration: waitDuration }
NumberAnimation { target: welcFour; property:
'opacity';from:0; to:1; duration:animDuration}
NumberAnimation { target: welcThree; property:
'opacity';from:1; to:0; duration:0}
PauseAnimation { duration: waitDuration }
NumberAnimation { target: welcFive; property:
'opacity';from:0; to:1; duration:animDuration}
NumberAnimation { target: welcFour; property:
'opacity';from:1; to:0; duration:0}
PauseAnimation { duration: waitDuration }
NumberAnimation { target: welcOne; property:
'opacity';from:0; to:1; duration:animDuration}
NumberAnimation { target: welcFive; property:
'opacity';from:1; to:0; duration:0}
PauseAnimation { duration: waitDuration }
}
}
Image{
id:welcOne
x:0
y:0
source:"images/Welcome/welcome_01.jpg"
opacity:0
}
Image{
id:welcTwo
x:0
y:0
source:"images/Welcome/welcome_02.jpg"
opacity:0
}
Image{
id:welcThree
x:0
y:0
source:"images/Welcome/welcome_03.jpg"
opacity:0
}
Image{
id:welcFour
x:0
y:0
source:"images/Welcome/welcome_04.jpg"
opacity:0
}
Image{
id:welcFive
x:0
y:0
source:"images/Welcome/welcome_05.jpg"
opacity:0
}
FocusScope
{
id:footer
x:0
y:700
focus:true
Behavior on y{NumberAnimation {
easing.type:Easing.OutElastic;duration:1000}}
Image{
x:0
y:0
source:"images/Welcome/welcomefooter.png"
}
Image{
id:enterBtn
focus:true
x:1008
y:55
source:"images/Welcome/enterbtn.png"
opacity:0
z:5
Behavior on opacity {NumberAnimation {
easing.type:Easing.OutBounce ;duration:500}}
MouseArea{
anchors.fill:parent
onReleased:{
someActivity()
}
}
Keys.onReleased:{
console.log("Key Release event")
if (event.key == Qt.Key_Enter || event.key ==
Qt.Key_Return || event.key == Qt.Key_Select )
{
someActivity()
}
}
}
}
Component.onCompleted:{welcomeAnimation.running=true;footer.y=560;enterBtn.opacity=1}
}
Warm Regards
~~~~~~~~~~~~~~~
Vinayak
http://www.flickr.com/photos/rightplacerighttime/
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml