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

        1. qtbug43436_diag_4.diff
          0.6 kB
          Friedemann Kleint
        2. qtbug43436_diag_5.diff
          2 kB
          Friedemann Kleint

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: