Qt5 drag and drop problem

I’ve encountered a problem with drag and drop functionality in Qt5. When I compile and run the draggableicons example program:

https://doc.qt.io/qt-5/qtwidgets-draganddrop-draggableicons-example.html

from qt5-qtbase-examples-5.12.5-1.fc31.x86_64 the dropEvent never fires rendering drag and drop, well, drag only. Not so useful! :slight_smile:

I should probably note that this also occurs when I use the precompiled version:
/usr/lib64/qt5/examples/widgets/draganddrop/draggableicons/draggableicons

When I run the Qt4 version (from package qt-examples-4.8.7-50.fc31.x86_64) of the same program it works just fine.
/usr/lib64/qt4/examples/draganddrop/draggableicons/draggableicons

Can anyone else verify this behavior? Also, any suggestions about how to further troubleshoot would be most welcome. I’m running kernel 5.3.14-300.fc31.x86_64.

I encountered a problem with drag&drop in OpenShot.
I’m not an expert, so I don’t know if it is the same issue as yours, but I read about a workaround, I can’t remember where, for QT programs on wayland.
env QT_QPA_PLATFORM=xcb openshot-qt

1 Like

Yes, that tells Qt to use X11 instead of native Wayland support. It runs just fine if I do that and matches my other findings, so thank you for that.

I followed the advice here:

https://fedoraproject.org/wiki/How_to_debug_Wayland_problems

Because this occurs on the mutter compositor but not on weston, I’m beginning to think this is a mutter problem. I ran the application under both compositors like this:

WAYLAND_DEBUG=1 /usr/lib64/qt5/examples/widgets/draganddrop/draggableicons/draggableicons

Comparing the result I see a wl_data_device@11.drop() under weston but not under mutter. I have also tried mutter-3.35.1-2.fc32.x86_64 from the Rawhide repo, but get the same result. I think I’ll do a little more digging and file a bug against mutter.

2 Likes

If anyone cares, I filed the bug