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

[regression from qt4] Can't mock drag-and-drop interaction without involving system's cursor

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.1.0
    • None
    • Fedora 18 and other platforms

      Sequence to reproduce:
      Post MouseButtonPress event (with correct localPos and globalPos) to draggable widget. Dragging mode should be initiated with start position in event->globalPos(). This works as expected in Qt4.8.
      In Qt5.1 dragging mode initiated in position of system cursor - wrong behavior, I guess.

      Seems to be issue in:

      void QSimpleDrag::startDrag()
      {
          QBasicDrag::startDrag();
          m_current_window = topLevelAt(QCursor::pos());
          if (m_current_window) {
              QPlatformDragQtResponse response = QWindowSystemInterface::handleDrag(m_current_window, drag()->mimeData(), QCursor::pos(), drag()->supportedActions());
              setCanDrop(response.isAccepted());
              updateCursor(response.acceptedAction());
          } else {
              setCanDrop(false);
              updateCursor(Qt::IgnoreAction);
          }
          setExecutedDropAction(Qt::IgnoreAction);
      }
      

      QWindowSystemInterface::handleDrag is passed with QCursor::pos() but there should be globalPos() from event that initiate dragging.

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

            Unassigned Unassigned
            andriy.prystupa Andriy Prystupa
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes