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

Modifiers are not reported on Mac

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.1.0 Beta 1
    • None
    • Mac OS X
    • macOS

    Description

      class TextEdit: public QTextEdit
      {
          Q_OBJECT
      public:
          TextEdit() {
      
          }
      protected:
          void keyPressEvent(QKeyEvent *e) {
              qDebug () << "keyPressEvent";
              if ((e->modifiers() & Qt::ControlModifier) == Qt::ControlModifier)
                  qDebug() << "ControlModifier";
              if ((e->modifiers() & Qt::AltModifier) == Qt::AltModifier)
                  qDebug() << "AltModifier";
              if ((e->modifiers() & Qt::ShiftModifier) == Qt::ShiftModifier)
                  qDebug() << "ShiftModifier";
              if ((e->modifiers() & Qt::MetaModifier) == Qt::MetaModifier)
                  qDebug() << "MetaModifier";
              QTextEdit::keyPressEvent(e);
          }
      };
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          qDebug() << qVersion();
          TextEdit ed;
          ed.show();
      
          return a.exec();
      }
      

      Attachments

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

        Activity

          People

            paeglis Gatis Paeglis
            paeglis Gatis Paeglis
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes