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

Esc key doesn't cancel drag and drop operation until mouse button release occurs

    XMLWordPrintable

Details

    Description

      When ESC key is pressed while dragging an item, if the mouse is navigated back to some drop area (without releasing the mouse button), the dragging is still active, this is different from the standard behaviour on Windows and Linux. Reproducible with the following example:

      #include <QtGui>
      
      class TreeWidget : public QTreeWidget
      {
          Q_OBJECT
      public:
          TreeWidget() : QTreeWidget(0)
          {
              setAcceptDrops(true);
              setDragEnabled(true);
              new QTreeWidgetItem(this, QStringList() << "Oak");
              new QTreeWidgetItem(this, QStringList() << "Fir");
              new QTreeWidgetItem(this, QStringList() << "Pine");
          }
      };
      
      #include "main.moc"
      
      int main(int argc, char **argv)
      {
          QApplication app(argc, argv);
          QWidget widget;
          TreeWidget box;
          QVBoxLayout layout(&widget);
          layout.addWidget(&box);
          widget.show();
          return app.exec();
      }
      

      Attachments

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

        Activity

          People

            vfm Thierry Bastian (closed Nokia identity) (Inactive)
            mpejcoch Martin Pejcoch (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