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

Keyboard modifiers not working in dragMoveEvent

    XMLWordPrintable

    Details

      Description

      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

        Attachments

        1. 57168.tar.gz
          1 kB
        2. qtbug57168.zip
          1 kB

          Issue Links

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

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes