Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
12#include <QtCore/qpointer.h>
13
15
16class QCocoaWindow;
17
19 , public QNativeInterface::Private::QCocoaMenuBar
20{
22public:
25
26 void insertMenu(QPlatformMenu *menu, QPlatformMenu* before) override;
27 void removeMenu(QPlatformMenu *menu) override;
28 void syncMenu(QPlatformMenu *menuItem) override;
29 void handleReparent(QWindow *newParentWindow) override;
30 QWindow *parentWindow() const override;
31 QPlatformMenu *menuForTag(quintptr tag) const override;
32
33 NSMenu *nsMenu() const override { return m_nativeMenu; }
34
35 static void updateMenuBarImmediately();
36 static void insertWindowMenu();
37
38 QList<QCocoaMenuItem*> merged() const;
41
42 void syncMenu_helper(QPlatformMenu *menu, bool menubarUpdate);
43
44private:
45 static QCocoaWindow *findWindowForMenubar();
46 static QCocoaMenuBar *findGlobalMenubar();
47
48 bool needsImmediateUpdate();
49 bool shouldDisable(QCocoaWindow *active) const;
50
51 NSMenuItem *nativeItemForMenu(QCocoaMenu *menu) const;
52
53 QList<QPointer<QCocoaMenu> > m_menus;
54 NSMenu *m_nativeMenu;
55 QPointer<QCocoaWindow> m_window;
56};
57
59
60#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
\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:167
QMenu menu
[5]