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

Android: context menu not displayed native

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.5.0
    • QPA
    • None

    Description

      QMenu attached to QMainWindow's menu bar are shown native:
      http://i.stack.imgur.com/Sove9.png

      However, when showing a context menu, it's not native (see attached screenshot) and are then hard to use for the user.

      It would be much better if all QMenu objects would display the platform native way.

      Code snippet reproducing the issue:

      #include <QApplication>
      #include <QMenuBar>
      #include <QMenu>
      #include <QAction>
      #include <QPushButton>
      #include <QVBoxLayout>
      #include <QMainWindow>
      
      int main( int argc, char* argv[] )
      {
          QApplication app(argc, argv);
          
          QMainWindow wnd;
          wnd.setMenuBar( new QMenuBar( &wnd ) );
      
          wnd.menuBar()->addMenu( "File" )->addAction( "Hello World native action" )->setCheckable( true );
      
          QPushButton* button = new QPushButton( "Show menu", &wnd );
          wnd.setCentralWidget( button );
      
          QMenu contextMenu;
          QAction* action = contextMenu.addAction( "Hello World not native action" );
      
          QObject::connect( button, SIGNAL(clicked()), &contextMenu, SLOT(show()) );
      
          wnd.show();
      
          return app.exec();
      }
      

      Attachments

        1. context.png
          523 kB
          Jean Porcherot

        Issue Links

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

          Activity

            People

              rampe Rami Potinkara
              jpo38 Jean Porcherot
              Veli-Pekka Heinonen Veli-Pekka Heinonen
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes