[SOLVED]QGuiApplication and 'About Menu' on OSX
-
Hi everyone,
I red somewhere in Qt's doc that Qt should handle by itself the 'About myApp' on OS X.
However I do not see it when I run my application.I am using Qt 5.4.0, my app is a QGuiApplication in which I have a QQuickView with the following flags:
@Qt::Window |
Qt::WindowTitleHint |
Qt::WindowSystemMenuHint |
Qt::WindowMinMaxButtonsHint |
Qt::WindowCloseButtonHint |
Qt::WindowFullscreenButtonHint@Am I missing something that makes the App to not have this menu ?
I also have a plist file with copyright, version and bundle version.
Thanks :)
-
You can have generic information about Qt displayed in the menu but you still need to put it there yourself.
To add this in your menu add QAction with the triggered() signal connected to the slot QApplication::aboutQt()
Note: On second read of the post this is probably off topic. I did check a program I wrote To see if I had an 'About Application'. I didn't do anything to make this happen but somehow it did and connected to the right 'page' of my program.
Note 2: After some additional checking I noticed it took the last QAction item added to the last QMenu item and turned this into my Qbout 'My App' option on OS X. Interesting...
-
I didn't do anything to add this (didn't even realize it did it until a moment ago).
In my case it was the last QAction item added to the last QMenu.
@
view_menu = new QMenu("View");
view_menu->addAction(d_components_action);
view_menu->addAction(d_variables_action);
view_menu->addAction(d_groups_action);
view_menu->addAction(d_report_action);
view_menu->addAction(d_log_action);
view_menu->addAction(d_about_action);
menu_bar->addMenu(view_menu);
@The 'd_about_action' doesn't appear in the menu under 'view' but under the application - about section.
I didn't do anything more than this and didn't give it any hints that this action should be treated special.
Even if you don't use QWidgets you can still create QAction and QMenu I assume?
-
Hi,
I havent't tested it but wouldn't the MenuBar from the QtQuick.Controls module allow to setup that ?
Hope it helps
-
To close the subject ( left open for a while ... ) I finally found the solution by using a QApplication instead of using a QGuiApplication and by creating a new QMenuBar with a QMenu named "aboutMyApp" that is automatically placed in the right place under OS X.