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

Keyboard modifiers do not work in wheelEvent

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P1: Critical
    • 5.2.0
    • 5.1.1
    • None
    • OSX

    Description

      If you derive from QWidget and re-implement wheelEvent to test for a keyboard modifier, it doesn't work.

      class Wid : public QWidget
      {
      Q_OBJECT
      public:
          Wid() {}
      protected:
          void wheelEvent(QWheelEvent *ev)
          {
              qDebug() << QApplication::keyboardModifiers().testFlag(Qt::ControlModifier);
              QWidget::wheelEvent(ev);
          }
      };
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          qDebug() << qVersion();
          Wid w;
          w.show();
      
          return a.exec();
      }
      

      It does work in mousePress and mouseMove however.

      This is a regression since Qt 4.

      Attachments

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

        Activity

          People

            dedietri Gabriel de Dietrich (drgvond)
            danny77uk Daniel
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes