Unsolved Bug on DragHandler ?
-
Hello,
I think there is a bug with DragHandler.
The acceptedButtons property has no effect and the drag occurs whatever button has been pressed.DragHandler { id: dragHandlerID target: null acceptedButtons: Qt.RightButton onActiveChanged: { console.log("Drag is activated"); } }
In the code above, "Drag is activated" is printed even if drag is performed with left button.
Tks in advance for your help.
-
Hi,
Gentle reminder :)
Tks in advance for your help.
-
@Nitroboy Please leave a least 24 hours before pushing your post.
People help in their spare time and do not necessary live in the same time zone as you.
Which Qt version are you using? On which platform?
Regards
-
Sorry for pushing.
I'm using Qt 5.12 (msvc2017_64) on Windows 10.Regards
-
It seems that TapHandler doesn't have this issue.
Did someone encounter the same issue with 5.12 ? -
Do you think it is a bug or I missing something ?
-
Hi,
This issue still persists on 5.13
Does someone encounter the same ?Tks in advance
-
It might be a bug - but my QML knowledge is limited so it might as well be intentional.
Have you already searched bugreports.qt.io for similar reports? If there is none, you can create a new one.
Please add a link here to the report here so others can follow later.
Thanks!
-
@aha_1980 Bug created : https://bugreports.qt.io/browse/QTBUG-76582
-
Please add a minimal reproducible example to the bug report.
-
@Christian-Ehrlicher I do add a reproducible example in the bug report.
And It's very easy to test.Just use the qml below to reproduce it.
DragHandler { id: dragHandlerID target: null acceptedButtons: Qt.RightButton onActiveChanged: { console.log("Drag is activated"); } }
If using left button when dragging, you are able to print "Drag is activated", this means that you just reproduce the bug.
Note : I add the same code to the bug report. -
At least a main.cpp is missing which loads this qml - the example should be self-contained and not a code snippet.
-
@Christian-Ehrlicher Got you :)
I just add a minimalist main.cpp and the related main.qml to the bug report.
Tks -
Can confirm this happens on MacOS and WASM as well.
Doesn't matter what the setting for
acceptedButtons
is on a DragHandler all mouse buttons cause the event to be fired.I have tested with
onTranslationChanged
as well and all mouse buttons (including middle) fire the event even though I am only setting RightButton as accepted as per @Nitroboy code sample.