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

Keyboard modifiers not working in dragMoveEvent

XMLWordPrintable

      related to QTBUG-26413.

      It looks to me that this is not just an OSX bug.
      Under windows this code does not seem to work either:

      struct TestWidget : public QWidget
      {
        virtual void dragEnterEvent(QDragEnterEvent* e) {
          e->accept();
        }
      
        virtual void dragMoveEvent(QDragMoveEvent* e) {
          qDebug() << "active keyboard modifiers" << QApplication::queryKeyboardModifiers() << e->keyboardModifiers();
      
        }
      };
      
      int main(int argc, char** argv)
      {
        QApplication app(argc, argv);
      
        TestWidget* tw = new TestWidget;
        tw->setAcceptDrops(true);
        tw->resize(300,300);
        tw->show();
      
        return app.exec();
      }
      

      Instructions:

      • build and run application
      • drag a file from explorer into the application window
      • while dragging hold down a keyboard modifier (alt, shift or control).
      • qDebug() output does not show the modifier pressed

        1. qtbug57168.zip
          1 kB
          Friedemann Kleint
        2. 57168.tar.gz
          1 kB
          Gatis Paeglis
        For Gerrit Dashboard: QTBUG-57168
        # Subject Branch Project Status CR V

            mikhailsvetkin Mikhail Svetkin
            stefanqt Stefan
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes