mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-06 09:15:23 +08:00
qt 6.5.1 original
This commit is contained in:
19
tests/manual/cocoa/menurama/CMakeLists.txt
Normal file
19
tests/manual/cocoa/menurama/CMakeLists.txt
Normal file
@ -0,0 +1,19 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## Menurama Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_manual_test(Menurama
|
||||
GUI
|
||||
SOURCES
|
||||
main.cpp
|
||||
mainwindow.cpp mainwindow.h mainwindow.ui
|
||||
menuramaapplication.cpp menuramaapplication.h
|
||||
LIBRARIES
|
||||
Qt::Gui
|
||||
Qt::Widgets
|
||||
ENABLE_AUTOGEN_TOOLS
|
||||
uic
|
||||
)
|
51
tests/manual/cocoa/menurama/main.cpp
Normal file
51
tests/manual/cocoa/menurama/main.cpp
Normal file
@ -0,0 +1,51 @@
|
||||
// Copyright (C) 2017 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "menuramaapplication.h"
|
||||
|
||||
#include <QtGui/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();
|
||||
|
||||
return a.exec();
|
||||
}
|
73
tests/manual/cocoa/menurama/mainwindow.cpp
Normal file
73
tests/manual/cocoa/menurama/mainwindow.cpp
Normal file
@ -0,0 +1,73 @@
|
||||
// Copyright (C) 2017 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "menuramaapplication.h"
|
||||
#include <QDebug>
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
auto *a = ui->menuStuff->addAction("Enabled Submenu (QTBUG-63172)");
|
||||
auto *qtbug63172_Menu = new QMenu;
|
||||
qtbug63172_Menu->addAction("We're Good!");
|
||||
a->setMenu(qtbug63172_Menu);
|
||||
|
||||
startTimer(1000);
|
||||
|
||||
connect(ui->menuAfter_aboutToShow, &QMenu::aboutToShow, [=] {
|
||||
menuApp->populateMenu(ui->menuAfter_aboutToShow, true /*clear*/);
|
||||
});
|
||||
|
||||
connect(ui->menuDynamic_Stuff, &QMenu::aboutToShow, [=] {
|
||||
menuApp->addDynMenu(QLatin1String("Menu Added After aboutToShow()"), ui->menuDynamic_Stuff);
|
||||
|
||||
const QLatin1String itemTitle = QLatin1String("Disabled Item Added After aboutToShow()");
|
||||
if (QAction *a = menuApp->findAction(itemTitle, ui->menuDynamic_Stuff))
|
||||
ui->menuDynamic_Stuff->removeAction(a);
|
||||
QAction *a = ui->menuDynamic_Stuff->addAction(itemTitle);
|
||||
a->setEnabled(false);
|
||||
});
|
||||
|
||||
connect(ui->pushButton, &QPushButton::clicked, [=] {
|
||||
menuApp->populateMenu(ui->menuOn_Click, true /*clear*/);
|
||||
});
|
||||
|
||||
connect(ui->addManyButton, &QPushButton::clicked, [=] {
|
||||
QMenu *menu = new QMenu(QLatin1String("Many More ") +
|
||||
QString::number(ui->menuBar->actions().count()));
|
||||
ui->menuBar->insertMenu(ui->menuDynamic_Stuff->menuAction(), menu);
|
||||
for (int i = 0; i < 2000; i++) {
|
||||
auto *action = menu->addAction(QLatin1String("Item ") + QString::number(i));
|
||||
if (i & 0x1)
|
||||
action->setEnabled(false);
|
||||
if (i & 0x2)
|
||||
action->setVisible(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MainWindow::timerEvent(QTimerEvent *)
|
||||
{
|
||||
menuApp->populateMenu(ui->menuPopulated_by_Timer, true /*clear*/);
|
||||
menuApp->addDynMenu(QLatin1String("Added by Timer"), ui->menuDynamic_Stuff);
|
||||
}
|
||||
|
||||
void MainWindow::enableStuffMenu(bool enable)
|
||||
{
|
||||
ui->menuStuff->setEnabled(enable);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionQuit_triggered()
|
||||
{
|
||||
menuApp->exit();
|
||||
}
|
34
tests/manual/cocoa/menurama/mainwindow.h
Normal file
34
tests/manual/cocoa/menurama/mainwindow.h
Normal file
@ -0,0 +1,34 @@
|
||||
// Copyright (C) 2017 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
protected:
|
||||
void timerEvent(QTimerEvent *) override;
|
||||
|
||||
public slots:
|
||||
void enableStuffMenu(bool enable);
|
||||
|
||||
private slots:
|
||||
void on_actionQuit_triggered();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
328
tests/manual/cocoa/menurama/mainwindow.ui
Normal file
328
tests/manual/cocoa/menurama/mainwindow.ui
Normal file
@ -0,0 +1,328 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>486</width>
|
||||
<height>376</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>The "Help" menu should NOT be visible.
|
||||
|
||||
Click on "Dynamic Stuff" then move left and right to other menus. Disabled items should remain that way.</string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="text">
|
||||
<string>Enable "Stuff" Menu</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Populate Dynamic Submenu</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item alignment="Qt::AlignTop">
|
||||
<widget class="QPushButton" name="addManyButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add Many Items</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item alignment="Qt::AlignTop">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Adding hundreds of items should not block the UI for noticeable periods of time. Odd numbered items should be disabled, those with 2nd LSB on should be hidden.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item alignment="Qt::AlignTop">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Check out the dock menu. You can close this window to verify that its actions will trigger in the absence of any window. And you can add more windows from there too.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>486</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuStuff">
|
||||
<property name="title">
|
||||
<string>Stuff</string>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuSubmenu">
|
||||
<property name="title">
|
||||
<string>Submenu</string>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuMore_Submenu_2">
|
||||
<property name="title">
|
||||
<string>More Submenu</string>
|
||||
</property>
|
||||
<addaction name="actionMOARH"/>
|
||||
</widget>
|
||||
<addaction name="actionWith_More_Stuff"/>
|
||||
<addaction name="menuMore_Submenu_2"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuDisabled_Submenu">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Disabled Submenu</string>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuMore_Submenu">
|
||||
<property name="title">
|
||||
<string>More Submenu</string>
|
||||
</property>
|
||||
<addaction name="actionShould_be_Disabled_Too"/>
|
||||
</widget>
|
||||
<addaction name="actionShould_be_Disabled"/>
|
||||
<addaction name="menuMore_Submenu"/>
|
||||
</widget>
|
||||
<addaction name="actionItem"/>
|
||||
<addaction name="menuSubmenu"/>
|
||||
<addaction name="actionDisabled_Item"/>
|
||||
<addaction name="menuDisabled_Submenu"/>
|
||||
<addaction name="separator"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuDisabled_Stuff">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Disabled Stuff</string>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuSubmenu_2">
|
||||
<property name="title">
|
||||
<string>Disabled Submenu</string>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuSubsubmenu">
|
||||
<property name="title">
|
||||
<string>Disabled Subsubmenu</string>
|
||||
</property>
|
||||
<addaction name="actionWith_its_own_Stuff"/>
|
||||
</widget>
|
||||
<addaction name="actionMore_Disabled_Stuff"/>
|
||||
<addaction name="menuSubsubmenu"/>
|
||||
</widget>
|
||||
<addaction name="actionItem_2"/>
|
||||
<addaction name="menuSubmenu_2"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuShould_NOT_Be_Visible">
|
||||
<property name="title">
|
||||
<string>Should NOT Be Visible</string>
|
||||
</property>
|
||||
<addaction name="actionAbout"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuHelp">
|
||||
<property name="title">
|
||||
<string>Help</string>
|
||||
</property>
|
||||
<addaction name="actionAbout_Qt"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuDynamic_Stuff">
|
||||
<property name="title">
|
||||
<string>Dynamic Stuff</string>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuAfter_aboutToShow">
|
||||
<property name="title">
|
||||
<string>Populated After aboutToShow()</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuOn_Click">
|
||||
<property name="title">
|
||||
<string>Click Button to Populate</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuPopulated_by_Timer">
|
||||
<property name="title">
|
||||
<string>Populated by Timer</string>
|
||||
</property>
|
||||
</widget>
|
||||
<addaction name="menuOn_Click"/>
|
||||
<addaction name="menuAfter_aboutToShow"/>
|
||||
<addaction name="menuPopulated_by_Timer"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
</property>
|
||||
<addaction name="actionNew"/>
|
||||
<addaction name="actionNo_Empty_Spaces_Below"/>
|
||||
<addaction name="actionQuit"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuStuff"/>
|
||||
<addaction name="menuDisabled_Stuff"/>
|
||||
<addaction name="menuShould_NOT_Be_Visible"/>
|
||||
<addaction name="menuDynamic_Stuff"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="mainToolBar">
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
<action name="actionWith_More_Stuff">
|
||||
<property name="text">
|
||||
<string>With More Stuff</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDisabled_Item">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Disabled Item</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionItem">
|
||||
<property name="text">
|
||||
<string>Item</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionShould_be_Disabled">
|
||||
<property name="text">
|
||||
<string>Should be Disabled</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionShould_be_Disabled_Too">
|
||||
<property name="text">
|
||||
<string>Should be Disabled Too</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMOARH">
|
||||
<property name="text">
|
||||
<string>MOAR!!</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionItem_2">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Disabled Item</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMore_Disabled_Stuff">
|
||||
<property name="text">
|
||||
<string>More Disabled Stuff</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionWith_its_own_Stuff">
|
||||
<property name="text">
|
||||
<string>With its own Disabled Stuff</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAbout">
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAbout_Qt">
|
||||
<property name="text">
|
||||
<string>About Qt</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionQuit">
|
||||
<property name="text">
|
||||
<string>Exit</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNew">
|
||||
<property name="text">
|
||||
<string>New...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNo_Empty_Spaces_Below">
|
||||
<property name="text">
|
||||
<string>No Empty Spaces Below</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>checkBox</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>MainWindow</receiver>
|
||||
<slot>enableStuffMenu(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>62</x>
|
||||
<y>94</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>72</x>
|
||||
<y>73</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<slots>
|
||||
<slot>enableStuffMenu(bool)</slot>
|
||||
</slots>
|
||||
</ui>
|
20
tests/manual/cocoa/menurama/menurama.pro
Normal file
20
tests/manual/cocoa/menurama/menurama.pro
Normal file
@ -0,0 +1,20 @@
|
||||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2016-08-10T14:21:46
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += core gui widgets
|
||||
|
||||
TARGET = Menurama
|
||||
TEMPLATE = app
|
||||
|
||||
|
||||
SOURCES += main.cpp\
|
||||
mainwindow.cpp \
|
||||
menuramaapplication.cpp
|
||||
|
||||
HEADERS += mainwindow.h \
|
||||
menuramaapplication.h
|
||||
|
||||
FORMS += mainwindow.ui
|
50
tests/manual/cocoa/menurama/menuramaapplication.cpp
Normal file
50
tests/manual/cocoa/menurama/menuramaapplication.cpp
Normal file
@ -0,0 +1,50 @@
|
||||
// Copyright (C) 2017 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "menuramaapplication.h"
|
||||
|
||||
MenuramaApplication::MenuramaApplication(int &argc, char **argv)
|
||||
: QApplication (argc, argv)
|
||||
{
|
||||
#if 0
|
||||
QMenuBar *mb = new QMenuBar();
|
||||
QMenu *menu = mb->addMenu("App Dynamic");
|
||||
QMenu *dynMenu = menu->addMenu("After aboutToShow()");
|
||||
connect(dynMenu, &QMenu::aboutToShow, [=] {
|
||||
qDebug() << "aboutToShow(), populating" << dynMenu;
|
||||
menuApp->populateMenu(dynMenu, true /*clear*/);
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
void MenuramaApplication::populateMenu(QMenu *menu, bool clear)
|
||||
{
|
||||
if (clear)
|
||||
menu->clear();
|
||||
|
||||
static const char *sym[] = { "Foo", "Bar", "Baz", "Huux" };
|
||||
static int id = 0;
|
||||
for (unsigned i = 0; i < sizeof(sym) / sizeof(sym[0]); i++)
|
||||
menu->addAction(QStringLiteral("%1 — %2 %3 ")
|
||||
.arg(menu->title()).arg(sym[i]).arg(id));
|
||||
++id;
|
||||
}
|
||||
|
||||
void MenuramaApplication::addDynMenu(QLatin1String title, QMenu *parentMenu)
|
||||
{
|
||||
if (QAction *a = findAction(title, parentMenu))
|
||||
parentMenu->removeAction(a);
|
||||
|
||||
QMenu *subMenu = new QMenu(title, parentMenu);
|
||||
populateMenu(subMenu, false /*clear*/);
|
||||
parentMenu->addMenu(subMenu);
|
||||
}
|
||||
|
||||
QAction *MenuramaApplication::findAction(QLatin1String title, QMenu *parentMenu)
|
||||
{
|
||||
foreach (QAction *a, parentMenu->actions())
|
||||
if (a->text() == title)
|
||||
return a;
|
||||
|
||||
return nullptr;
|
||||
}
|
22
tests/manual/cocoa/menurama/menuramaapplication.h
Normal file
22
tests/manual/cocoa/menurama/menuramaapplication.h
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2017 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#ifndef MENURAMAAPPLICATION_H
|
||||
#define MENURAMAAPPLICATION_H
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#define menuApp (static_cast<MenuramaApplication *>(QCoreApplication::instance()))
|
||||
|
||||
class MenuramaApplication : public QApplication
|
||||
{
|
||||
public:
|
||||
MenuramaApplication(int &argc, char **argv);
|
||||
void addDynMenu(QLatin1String title, QMenu *parentMenu);
|
||||
QAction *findAction(QLatin1String title, QMenu *parentMenu);
|
||||
|
||||
public slots:
|
||||
void populateMenu(QMenu *menu, bool clear);
|
||||
};
|
||||
|
||||
#endif // MENURAMAAPPLICATION_H
|
Reference in New Issue
Block a user