Comment 6 for bug 1296832

Revision history for this message
Zsombor Egri (zsombi) wrote :

As workaround, use this to handle double clicks in the PinchArea and remove MouseArea from there:

        MultiPointTouchArea {
            anchors.fill: parent
            Timer {
                id: dblTapTimeout
                interval: 600
                repeat: false
                onTriggered: dblTapHandler.pressCount = 0
            }

            touchPoints: TouchPoint {
                id: dblTapHandler
                property int pressCount: 0
                onPressedChanged: {
                    if (pressed) {
                        pressCount++;
                        dblTapTimeout.running = true;
                    } else {
                        if (pressCount === 2) {
                            // handle double click
                            console.log("DBLTap")
                            pressCount = 0;
                            dblTapTimeout.stop();
                        }
                    }
                }
            }
        }

This could be kept even if the upstream bug gets fixed, and have a MouseArea that is enabled only if the form factor hints desktop. Those hints will land later to UITK.