Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.5.0
-
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
Issue Links
- resulted in
-
QTBUG-52010 REG: Menus no longer native in widget apps on Android
-
- Closed
-