Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.5.3, 4.6.0
-
None
-
MS Windows XP SP2, Russian edition. VS 2008
-
35c3fa47082d6d580a9f1cfe0543e2d443f00d95
Description
Sometimes a Drag/Drop operation doesn't finish after the left mouse button has been released. Instead of a Drop a small movement of the draggable image occurs. This is the problem not only of my project but of almost all of the drag/drop QT examples. Having done some digging I found out that the QOleDropSource::QueryContinueDrag function (file qdnd_win.cpp) doesn't always receive a proper grfKeyState value (similar to WinCE). Making the same check as for WinCE solves the problem. These are the changed lines:
if (fEscapePressed) { return ResultFromScode(DRAGDROP_S_CANCEL); // } else if (!(grfKeyState & (MK_LBUTTON|MK_MBUTTON|MK_RBUTTON))) { // grfKeyState is broken on some WinXP, therefore need to check // the state manually } else if ((GetAsyncKeyState(VK_LBUTTON) == 0) && (GetAsyncKeyState(VK_MBUTTON) == 0) && (GetAsyncKeyState(VK_RBUTTON) == 0)) { return ResultFromScode(DRAGDROP_S_DROP); } else { #if defined(Q_OS_WINCE)
Best regards