dragArea only works if onGestureStart signal is defined

Bug #823190 reported by Darren West
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OIF-qml
Fix Released
Medium
Chase Douglas
utouch-qml (Ubuntu)
Fix Released
Medium
Chase Douglas

Bug Description

Doesn't work:

UTouchDragArea {
        anchors.fill : touch
        subscription {
            touches.start : 2
        }
        onGestureUpdate : console.log( 'UPDATE' )
    }

Works:

UTouchDragArea {
        anchors.fill : touch
        subscription {
            touches.start : 2
        }
        onGestureStart : console.log( 'START' )
        onGestureUpdate : console.log( 'UPDATE' )
    }

Related branches

Revision history for this message
Chase Douglas (chasedouglas) wrote :

This is by design. It mimics the (intended) behavior of QtQuick's MouseArea. If you don't have a signal handler defined for the events, then it's assumed that you do not accept the events. I thought I had documented this, but apparently I hadn't.

Is there a use case for when you want updates or ends without begins? If there's no use case I'll still leave this bug open as a reminder to document this behavior.

Changed in utouch-qml:
status: New → Incomplete
importance: Undecided → Medium
assignee: nobody → Chase Douglas (chasedouglas)
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
    }
}

Revision history for this message
Chase Douglas (chasedouglas) wrote :

Right now the code checks if anyone is listening to onGestureStart, centroid.onOriginalChanged, centroid.onCurrentChanged, and onActiveChanged. After thinking about this some more I feel this is a bit broken as some things cause gesture acceptance and others do not.

I now think we should accept the gesture if anyone is listening to any signals emitted by the area, including onGestureUpdate.

Changed in utouch-qml:
status: Incomplete → Triaged
Changed in utouch-qml:
status: Triaged → Fix Released
Changed in utouch-qml (Ubuntu):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Chase Douglas (chasedouglas)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package utouch-qml - 1.0.4-0ubuntu1

---------------
utouch-qml (1.0.4-0ubuntu1) oneiric; urgency=low

  * New upstream release.
    - Fixes issue with gesture acceptance (LP: #823190)
    - Fixes error when run under qmlviewer -frameless (LP: #823194)
    - Documentation now reflects whether gesture area is continuous or
      instantaneous (LP: #823819)
 -- Chase Douglas <email address hidden> Wed, 10 Aug 2011 17:06:49 -0700

Changed in utouch-qml (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.