Comment 2 for bug 823190

Revision history for this message
Darren West (darren-west) wrote :

With regards the MouseArea, when you say intended, I guess you don't mean actual, as I am able to set a onReleased signal handler which is triggered as expected without the need for a prior onPressed signal handler being set.

The use case for having a gestureUpdate signal handler without the need for a gestureStart signal handler would be in the case of triggering something when a certain condition has been met, for example:

if ( centroid.current.y < centroid.initial.y - 20 ) // do something

As there is no need to set the initial co-ordinate like I would do in a MouseArea as this is stored as centroid.initial already?

For example, in a MouseArea I would do something like:

MouseArea {
    property real initialY : 0
    onPressed : initialY = mouseY
    onReleased : {
        if ( mouseY < initialY - 20 ) // so something
    }
}