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

Drag and drop with embedded widget: drag icon offset is wrong

    XMLWordPrintable

Details

    Description

      If text is dragged from an embedded text edit or main window with docks, then it will be seen that the drag offset is wrong. It seems to be calculated relative to the distance between the cursor and the "actual" position of the window. This causes the drag icon to be drawn far away from the cursor.

      In the following test case notice how the drag icon is visible only in non-embedded mode.

      Test case main.cpp to reproduce
      ===============================
      #include <QtGui>

      int main(int argc, char **argv)
      {
      QApplication app(argc, argv);

      QListWidget listWidget;
      listWidget.setDragEnabled(true);

      for (int i = 0; i < 10; ++i)

      { QListWidgetItem *item = new QListWidgetItem("Hello"); item->setFlags(item->flags() | Qt::ItemIsDragEnabled); listWidget.addItem(item); }

      #if 1
      QGraphicsScene scene;
      scene.addWidget(&listWidget);
      QGraphicsView view(&scene);
      view.show();
      #else
      listWidget.show();
      #endif

      return app.exec();
      }

      Attachments

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

        Activity

          People

            smd Jan Arve
            hanssen Andreas Aardal Hanssen (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes