Drag n drop problem with Linux
-
Hi, I got a small application with drag n drop in a treeview perfectly working on windows. When i try it on linux (Ubuntu) I got many problems :
- I don't have any visual feedback when I move items around ( no action icons ( move, copy, forbidden))
- When I accept an event only once in the dragMoveEvent function during the movement of an item, the dropEvent function will be called, even if I ignore the event after.
=> The only way for the dropEvent to not be called is to avoid passing over an "acceptable droppable location"
Any idea ?
Thanks in advance
Meyer -
Which distro & which WM? Can you post some skeleton code which demonstrates the issue? And are you dragging within your app or across applications?
@stryga42 Ubuntu 22.04.2 LTS with the standard wayland WM.
I am dragging within my app (I drag a treeItem from its location to another in the same treeview).The code itself is very basic and it works as expected on windows
void ProjectWidget::dragMoveEvent(QDragMoveEvent * event) { QTreeWidgetItem* currentItem = itemAt(event->position().toPoint()); if (currentItem == NULL) { event->ignore(); return; } if (latestDraggedItem == NULL) { event->ignore(); return; } QVariant v = latestDraggedItem->data(0,Qt::UserRole); if (v.value<ModelTemplate *>()) { if (currentItem == cardNode) { event->setDropAction(Qt::MoveAction); event->accept(); return; } } event->ignore(); }