[Qt-qml] How to ignore MouseArea signals
Halton Huo
halton.huo at intel.com
Tue Dec 7 08:31:26 CET 2010
Hi,
I'm thinking to implement a TimedOverlay module, which has
functionality:
1. Fade out children in given time (containerInterval)
2. Fade in children when click anything in parent
To accept the click signal for the parent, I put a blank item with same
size of parent. There mark the visble property to true.
But I found only the latest added one can be shown when click on main
window. I think it is because the latest TimedOverlay accept the click
signal, so that others did not receive it.
So my questions how to ignore the received signals to let other items to
continue deal with those signals?
Thanks,
Halton.
-------------- next part --------------
import Qt 4.7
Item {
width: 640
height: 480
TimedOverlay {
Rectangle {
visible: parent.containerVisible
x: 300
y: 200
width: 50
height: 50
color: "red"
MouseArea {
anchors.fill: parent
onClicked: {
}
}
}
}
TimedOverlay {
containerInterval: 3000
Rectangle {
visible: parent.containerVisible
x: 500
y: 200
width: 50
height: 50
color: "green"
MouseArea {
anchors.fill: parent
onClicked: {
}
}
}
}
}
-------------- next part --------------
import Qt 4.7
Item {
width: parent.width
height: parent.height
property bool containerVisible: true
property int containerInterval: 1000
Item {
width: parent.width
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
myTimer.running = true
containerVisible = true
}
}
}
Timer {
id: myTimer
interval: containerInterval; running: true; repeat: true
onTriggered: {
containerVisible = false
myTimer.running = false
}
}
}
More information about the Qt-qml
mailing list