summaryrefslogtreecommitdiffstats
path: root/tests/manual/cocoa/menurama/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/cocoa/menurama/main.cpp')
-rw-r--r--tests/manual/cocoa/menurama/main.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/manual/cocoa/menurama/main.cpp b/tests/manual/cocoa/menurama/main.cpp
index 00594b6d1f..e39c01ea4d 100644
--- a/tests/manual/cocoa/menurama/main.cpp
+++ b/tests/manual/cocoa/menurama/main.cpp
@@ -29,9 +29,46 @@
#include "mainwindow.h"
#include "menuramaapplication.h"
+#include <QtWidgets/QAction>
+#include <QtWidgets/QMenu>
+
int main(int argc, char *argv[])
{
MenuramaApplication a(argc, argv);
+ a.setQuitOnLastWindowClosed(false);
+
+ auto *dockMenu = new QMenu();
+ dockMenu->setAsDockMenu();
+ dockMenu->addAction(QLatin1String("New Window"), [=] {
+ auto *w = new MainWindow;
+ w->setAttribute(Qt::WA_DeleteOnClose, true);
+ w->show();
+ });
+ auto *disabledAction = dockMenu->addAction(QLatin1String("Disabled Item"), [=] {
+ qDebug() << "Should not happen!";
+ Q_UNREACHABLE();
+ });
+ disabledAction->setEnabled(false);
+ dockMenu->addAction(QLatin1String("Last Item Before Separator"), [=] {
+ qDebug() << "Last Item triggered";
+ });
+ auto *hiddenAction = dockMenu->addAction(QLatin1String("Invisible Item (FIXME rdar:39615815)"), [=] {
+ qDebug() << "Should not happen!";
+ Q_UNREACHABLE();
+ });
+ hiddenAction->setVisible(false);
+ dockMenu->addSeparator();
+ auto *toolsMenu = dockMenu->addMenu(QLatin1String("Menurama Tools"));
+ toolsMenu->addAction(QLatin1String("Hammer"), [=] {
+ qDebug() << "Bang! Bang!";
+ });
+ toolsMenu->addAction(QLatin1String("Wrench"), [=] {
+ qDebug() << "Clang! Clang!";
+ });
+ toolsMenu->addAction(QLatin1String("Screwdriver"), [=] {
+ qDebug() << "Squeak! Squeak!";
+ });
+
MainWindow w;
w.show();