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

App native menu not visible on Android 9

XMLWordPrintable

    • Android
    • 2025wk40s2-3QtforAndroid

      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.

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

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

              Created:
              Updated:

                There are no open Gerrit changes