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

App native menu not visible on Android 9

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.8.1
    • GUI: Window management
    • None
    • Android
    • 2025Season1QtforAndroid

    Description

      Just deploy this very simple program on an Android device:

      #include <QApplication>
      #include <QMenuBar>
      #include <QMenu>
      #include <QMainWindow>
      #include <QLabel>
      int main( int argc, char* argv[] )
      {
          QApplication app(argc, argv);
          
          QMainWindow wnd;
          wnd.menuBar()->addMenu( "File" )->addAction( "Hello World native action" );
          wnd.setCentralWidget(new QLabel("Hello"));
          wnd.show();
      
          return app.exec();
      }
      

       

      I tested various Android versions:

      • On Android 6 and 10, the app menu is visible (see attached screenshot)
      • On Android 9, the app menu is not visible (see attached screenshot)

      App menu should always be visible.

      Note: On Android 9, a workaround is too call `QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar);` but then menu does not look very nice on an Android device.

      Note, I tested both Qt 6.2 and 6.8, I see the same issue.

      Attachments

        1. android10.jpg
          android10.jpg
          92 kB
        2. android9.jpg
          android9.jpg
          25 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtandroidteam Qt Android Team
            jpo38 Jean Porcherot
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes