Bug in Qt 5.12 drag n'drop ?
-
@armindev said in Bug in Qt 5.12 drag n'drop ?:
I will try this but this will take a while ..
Thx and take your time. There seems to be something wrong in a corner case and it would be really good to find it out :)
-
Hi there and thx for reading and answering if you can.
My app based on Qt5 x86_64 worked fine with qt5.11 but suddenly, the drag n'drop doesn't work anymore with qt5.12 ?
Have you already noticed this behaviour ? Is this a bug ?
Thx again for reading this post.
wrote on 31 Dec 2018, 01:37 last edited by@skylendar
I found same bug in my app. change to 5.11.2 drop is ok -
wrote on 31 Dec 2018, 09:05 last edited by
I have checked the drag & drop in my app when running on Ubuntu 16.04. The drag is from a QListWidgetItem to a drop on a QGraphicsView. I appropriately overrode QGraphicsView::dropEvent (and all the drag methods of QGraphicsView). It still works in Qt5.12.0 although the willingness to accept the QMimeData constructed from the QListWidgetItem as a droppable on the QGraphicsView (visible as a change in the mouse pointer icon) seems to be less than it was with Qt5.7 that I used up to yesterday. No clue whether this is in any way related, but perhaps it brings some ideas of what causes the issue for dropping on a QLineEdit.
-
@ModelTech can you provide a minimal compilable example that shows that change of behaviour ?
-
wrote on 2 Jan 2019, 17:56 last edited by ReDEnergy 1 Feb 2019, 17:57
Hi. I had the same problem. Everything worked fine on Qt 5.7 then after I updated to Qt 5.12 dropping would not work at all.
At least in my case it seems that for previous version of Qt only implementingdragEnterEvent
was enough but with 5.12 I had to also override thedragMoveEvent
event.
So, basically I have this 2 things and now it works as expected. Hope it helps someone.void QtDropArea::dragEnterEvent(QDragEnterEvent *event) { event->acceptProposedAction(); } // this was added after updating to Qt 5.12 void QtDropArea::dragMoveEvent(QDragMoveEvent *event) { event->acceptProposedAction(); }
-
-
wrote on 2 Jan 2019, 18:44 last edited by ReDEnergy 1 Feb 2019, 18:45
from the classic
QWidget
-
Thx for your hint with the dragMoveEvent() reimpl. I think I can reproduce your issue and also found the corresponding commit.
-
Lifetime Qt Championwrote on 2 Jan 2019, 20:42 last edited by aha_1980 1 Mar 2019, 06:21
Can you please check if you get a dragEnterEvent in the problematic case? I would guess no.
The problem was introduced with f8944a7f07112c85dc4f66848cabb490514cd28e which is a bugfix for QTBUG-67155. -
wrote on 3 Jan 2019, 00:04 last edited by
Great to hear that. So, I suppose what I did is a workaround for the moment, but at least it works.
-
Can you please check if you get a dragEnterEvent in the problematic case? I would guess no.
The problem was introduced with f8944a7f07112c85dc4f66848cabb490514cd28e which is a bugfix for QTBUG-67155.@Christian-Ehrlicher I already did some cross-links, can you create a bugreport for that issue?
-
Lifetime Qt Championwrote on 3 Jan 2019, 19:25 last edited by Christian Ehrlicher 1 Mar 2019, 19:41
-
The bug will be fixed in 5.12.1