Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-6604

DragDrop operations sometimes don't end properly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.7.0
    • 4.5.3, 4.6.0
    • GUI: Drag and Drop
    • 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

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            pullatti Prasanth Ullattil
            alexex Letov Alexey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes