Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.9.0
-
None
-
Ubuntu 16.04.1 on x86_64
Description
A MouseArea can either propagate events or have a correctly working onPressedChanged handler, but not both. Minimal example: a MouseArea fully covering a scrollable ListView, as in the following minimal (non-)working example:
import QtQuick 2.6 import QtQuick.Window 2.2 Window { visible: true width: 640 height: 480 title: qsTr("Hello World") ListView { model: [Qt.rgba(1,0,0,0.5),"red","green","blue"] delegate: Rectangle { height: 200 width: parent.width color: modelData } anchors.fill: parent } MouseArea { anchors.fill: parent onPressed: { mouse.accepted = false; } onReleased: { mouse.accepted = false; } onPressedChanged: { console.log("pressed changed to " + pressed); } propagateComposedEvents: true } }
There's something odd going on with the notification for the pressed property: onPressedChanged only gets called when the button is pressed. Moreover in this situation, pressed evaluates to false in onPressedChanged, which is the reason why I am filing this as a bug.
This happens regardless of "propagateComposedEvents". Only when "mouse.accepted=false;" is left out, does the pressed property get updated correctly (but then, of course, the ListView doesn't see the events at all, which isn't what I want).
Attachments
Issue Links
- relates to
-
QTBUG-38765 When propagateComposedEvents is set, drag does not always move the flickable
- Closed