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

REG [5.3-5.4] XCB: Drag Drop to other application doesn't work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • None
    • 5.4.0
    • None
    • Linux / Qt 5.4.0

    Description

      The basis drag / drop functionality doesn't work anymore. The following example works in Qt 5.3.2 but not in Qt 5.4.0:

      void ListView::mouseMoveEvent(QMouseEvent* event)
      {
          TRACE;
          if (!(event->buttons() & Qt::LeftButton)) {
              return;
          }
          if ((event->pos() - mMousePressPosition).manhattanLength() < QApplication::startDragDistance()) {
              return;
          }
          QDrag* drag = new QDrag(this);
          QMimeData* mimeData = new QMimeData;
      
          mimeData->setText(QString::fromLatin1("ABC"));
          mimeData->setUrls(QList<QUrl>() << QUrl::fromLocalFile("./test.cc"));
      
          drag->setMimeData(mimeData);
      
          qDebug() << Q_FUNC_INFO << mimeData->text();
          qDebug() << Q_FUNC_INFO << mimeData->urls();
      
          Qt::DropAction dropAction = drag->exec(Qt::CopyAction | Qt::MoveAction, Qt::CopyAction);
      
          qDebug() << Q_FUNC_INFO << "drop:" << dropAction;
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              paeglis Gatis Paeglis
              wilopaan Wilhelm Meier
              Votes:
              4 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes