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

QWidget project cannot receive Android 'Menu' hardware key

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • Some future release
    • 5.1.0 , 5.1.1
    • None
    • Ubuntu Linux on X86_64 bit
      Android SDK latest (August 13)
      Android NDK r9
      Qt 5.1.1
      Target is: Android_for_arm_GCC_4_8_Qt_5_1_1

    Description

      We need to make our Qt app interact with the Android 'Menu' hardware key. So far we can interact with the 'Back' and 'Search' keys OK. Here is the code that does not work (MainWindow class is derived from QWidget).

      void MainWindow::keyPressEvent(QKeyEvent *ev)
      {
      int key = ev->key();

      if (key == Qt::Key_Menu)

      { label5->setText("Hey you just hit the Menu key"); return; }

      label5->setText(QString("Hey you just hit the (%1) key").arg(key));
      QWidget::keyPressEvent(ev);
      }

      This code will display the Search-key code when pressed, but there is no output at all when the 'Menu' key is pressed.

      Regards,
      Chris

      Attachments

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              xped Chris Wood
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes