Qt 4.8.3 broke Drag&Drop (4.8.4 too?), what now ???
-
I also have a problem with drag & drop in windows. It started with Qt 4.7 up to the latest version.
(So I stopped using drag and drop until it is fixed). The Qt examples only work when it comes to Qt-to-Qt interaction and not with Qt-to-other programs or vice versa (e.g. a file coming from any directories using windows explorer.Hope the developers can fix this.
-
Well, Qt 4.8.2 it was still working fine for me (Windows). In Qt 4.8.3 there was a problem with Drag&Drop, but there's a patch available (see above). My own Qt 4.8.3 builds incorporating that patch seem to work fine too. But now I tried Qt 4.8.4 (RC4), which I though includes the patch (!?), but I again get the problem. It's just like the window doesn't accept drop's. I only get a "Stop" sign cursor. Went back to 4.8.2, just to be sure, and problem gone immediately. Too bad, because this is one of the things many of my users complain about...
[EDIT]
Strange enough, the 4.8 branch apparently does include the patch:
http://qt.gitorious.org/qt/qt/blobs/4.8/src/gui/kernel/qdnd_win.cpp#line717 -
[quote author="Lukas Geyer" date="1354181269"]If it does not work please update the bug report as soon as possible so we don't have it broken again in 4.8.4.[/quote]
Hopefully the dev's will see it there :-)
-
Addendum:
Here is my application, binary based on Qt 4.8.2 (last one that was good):
http://code.google.com/p/mulder/downloads/detail?name=x264_x64.2012-11-28.exe&can=2&q=Here is my application, binary based on Qt 4.8.4 RC-4 (official DLL's) with broken Drag'n'Drop:
http://code.google.com/p/mulder/downloads/detail?name=x264_x64.2012-11-28.Qt-484-RC4-Broken.exe&q=Sources:
https://bitbucket.org/lord_mulder/simple-x264-launcher/srcYou can check easily that, with Qt 4.8.4 RC-4, the following function never gets called:
void MainWindow::dragEnterEvent(QDragEnterEvent *event) -
Well, as mentioned above, in the 4.8 branch of Qt's repository (on Gitorious), the patch apparently is included. So I assume (hope) the 4.8.4 release does have it too. What confuses me is that with my own "static" builds of Qt 4.8.3 and the same patch included, there was no problem for me. Now with 4.8.4 (official DLL's) I again do have the problem. Maybe something else has changed after 4.8.3 that again causes problems...
Also, this is from the Qt 4.8.4 changelog:
@Qt for Windows[...]
Fix Drag and Drop with Native Widgets [QTBUG-27265]@ -
Update:
Okay, I spent the evening trying to create a minimal example application that reproduces the issue, as was requested in the bugtracker. To my surprise, this time I couldn't get Drag&Drop to work at all - neither with Qt 4.8.4 nor with Qt 4.8.2. Although I had re-implemented dragEnterEvent() it just never got called.
Then I found the reason: I didn't call setAcceptDrops(true) in my example application. After adding that call, Drag&Drop now is working with both, Qt 4.8.2 and Qt 4.8.4. Bummer! Nonetheless in my "actual" application I do not call setAcceptDrops(true) anywhere. I double checked that. I only re-implemented dragEnterEvent(). Adding the missing setAcceptDrops(true) call fixed my "actual" application with Qt 4.8.4 immediately. Doah!
!http://www.illninofans.de/soad/images/smilies/wand.gif(head-against-wall)!
Still I can't understand: How comes it ever worked? And why only with Qt 4.8.2, not with Qt 4.8.4 ???
(Really, I can't find anything in my "actual" application that enables Drag&Drop without calling setAcceptDrops(true) and that would explain why it only works with Qt up to and including 4.8.2, but not 4.8.4. Any ideas or hints?)
-
Whom it may concern:
I had the same problem with drag and drop working fine under Mac and Linux and with issues under Windows. Only the title bar was sensitive to drops.
The solution was, that I had some global event filters (qApp->installEventFilter(..)) installed, which lacked some pass throughs. I just wonder, why it worked under the other OS.Tags I searched for: qt windows drop area title bar
Edit: The fixed event filter didn't solve the problem, it reappeared if built in release mode. I had to set all child widgets manually to accept drops. The menu and the toolbar still don't accept drops, but this is not tragic.
Tags I searched for: qt windows release debug drag drop