Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qcocoamenubar.h
Go to the documentation of this file.
1// Copyright (C) 2018 The Qt Company Ltd.
2// Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author James Turner <james.turner@kdab.com>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QCOCOAMENUBAR_H
6#define QCOCOAMENUBAR_H
7
8#include <QtCore/QList>
9#include <qpa/qplatformmenu.h>
10#include "qcocoamenu.h"
11
13
14class QCocoaWindow;
15
17 , public QNativeInterface::Private::QCocoaMenuBar
18{
20public:
23
24 void insertMenu(QPlatformMenu *menu, QPlatformMenu* before) override;
25 void removeMenu(QPlatformMenu *menu) override;
26 void syncMenu(QPlatformMenu *menuItem) override;
27 void handleReparent(QWindow *newParentWindow) override;
28 QWindow *parentWindow() const override;
29 QPlatformMenu *menuForTag(quintptr tag) const override;
30
31 NSMenu *nsMenu() const override { return m_nativeMenu; }
32
33 static void updateMenuBarImmediately();
34 static void insertWindowMenu();
35
39
40 void syncMenu_helper(QPlatformMenu *menu, bool menubarUpdate);
41
42private:
43 static QCocoaWindow *findWindowForMenubar();
44 static QCocoaMenuBar *findGlobalMenubar();
45
46 bool needsImmediateUpdate();
47 bool shouldDisable(QCocoaWindow *active) const;
48
49 NSMenuItem *nativeItemForMenu(QCocoaMenu *menu) const;
50
52 NSMenu *m_nativeMenu;
54};
55
57
58#endif
NSMenu * nsMenu() const override
QList< QCocoaMenuItem * > merged() const
NSMenuItem * itemForRole(QPlatformMenuItem::MenuRole role)
void removeMenu(QPlatformMenu *menu) override
static void updateMenuBarImmediately()
void syncMenu_helper(QPlatformMenu *menu, bool menubarUpdate)
void syncMenu(QPlatformMenu *menuItem) override
void handleReparent(QWindow *newParentWindow) override
void insertMenu(QPlatformMenu *menu, QPlatformMenu *before) override
QCocoaWindow * cocoaWindow() const
QWindow * parentWindow() const override
static void insertWindowMenu()
QPlatformMenu * menuForTag(quintptr tag) const override
Definition qlist.h:74
\inmodule QtCore
Definition qpointer.h:18
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
AudioChannelLayoutTag tag
#define Q_OBJECT
size_t quintptr
Definition qtypes.h:72
QMenu menu
[5]