Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquicklabsplatformmenubar_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QQUICKLABSPLATFORMMENUBAR_P_H
6#define QQUICKLABSPLATFORMMENUBAR_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/qobject.h>
20#include <QtQml/qqmlparserstatus.h>
21#include <QtQml/qqmllist.h>
22#include <QtQml/qqml.h>
23#include <QtCore/private/qglobal_p.h>
24
26
27class QWindow;
28class QPlatformMenuBar;
30
32{
33 Q_OBJECT
34 QML_NAMED_ELEMENT(MenuBar)
39 Q_CLASSINFO("DefaultProperty", "data")
40
41public:
42 explicit QQuickLabsPlatformMenuBar(QObject *parent = nullptr);
44
45 QPlatformMenuBar *handle() const;
46
49
50 QWindow *window() const;
51 void setWindow(QWindow *window);
52
54 Q_INVOKABLE void insertMenu(int index, QQuickLabsPlatformMenu *menu);
56 Q_INVOKABLE void clear();
57
61
62protected:
63 void classBegin() override;
65
66 QWindow *findWindow() const;
67
68 static void data_append(QQmlListProperty<QObject> *property, QObject *object);
69 static qsizetype data_count(QQmlListProperty<QObject> *property);
70 static QObject *data_at(QQmlListProperty<QObject> *property, qsizetype index);
71 static void data_clear(QQmlListProperty<QObject> *property);
72
73 static void menus_append(QQmlListProperty<QQuickLabsPlatformMenu> *property, QQuickLabsPlatformMenu *menu);
74 static qsizetype menus_count(QQmlListProperty<QQuickLabsPlatformMenu> *property);
75 static QQuickLabsPlatformMenu *menus_at(QQmlListProperty<QQuickLabsPlatformMenu> *property, qsizetype index);
76 static void menus_clear(QQmlListProperty<QQuickLabsPlatformMenu> *property);
77
78private:
79 bool m_complete;
80 QWindow *m_window;
81 QList<QObject *> m_data;
82 QList<QQuickLabsPlatformMenu *> m_menus;
83 QPlatformMenuBar *m_handle;
84};
85
86QT_END_NAMESPACE
87
88#endif // QQUICKLABSPLATFORMMENUBAR_P_H
void setIcon(const QQuickLabsPlatformIcon &icon)
QQuickLabsPlatformIcon icon() const
bool operator==(const QQuickLabsPlatformIcon &other) const
QQmlListProperty< QObject > data()
Q_INVOKABLE void removeMenu(QQuickLabsPlatformMenu *menu)
\qmlmethod void Qt.labs.platform::MenuBar::removeMenu(Menu menu)
static qsizetype data_count(QQmlListProperty< QObject > *property)
static qsizetype menus_count(QQmlListProperty< QQuickLabsPlatformMenu > *property)
Q_INVOKABLE void clear()
\qmlmethod void Qt.labs.platform::MenuBar::clear()
static void menus_clear(QQmlListProperty< QQuickLabsPlatformMenu > *property)
static QQuickLabsPlatformMenu * menus_at(QQmlListProperty< QQuickLabsPlatformMenu > *property, qsizetype index)
static QObject * data_at(QQmlListProperty< QObject > *property, qsizetype index)
void classBegin() override
Invoked after class creation, but before any properties have been set.
QWindow * window() const
\qmlproperty Window Qt.labs.platform::MenuBar::window
Q_INVOKABLE void insertMenu(int index, QQuickLabsPlatformMenu *menu)
\qmlmethod void Qt.labs.platform::MenuBar::insertMenu(int index, Menu menu)
static void data_clear(QQmlListProperty< QObject > *property)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
QQmlListProperty< QQuickLabsPlatformMenu > menus()
static void menus_append(QQmlListProperty< QQuickLabsPlatformMenu > *property, QQuickLabsPlatformMenu *menu)
Q_INVOKABLE void addMenu(QQuickLabsPlatformMenu *menu)
\qmlmethod void Qt.labs.platform::MenuBar::addMenu(Menu menu)
QPlatformMenuBar * handle() const
void setIcon(const QQuickLabsPlatformIcon &icon)
void setMenu(QQuickLabsPlatformMenu *menu)
void setSubMenu(QQuickLabsPlatformMenu *menu)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
static QQuickLabsPlatformMenuItem * items_at(QQmlListProperty< QQuickLabsPlatformMenuItem > *property, qsizetype index)
static QObject * data_at(QQmlListProperty< QObject > *property, qsizetype index)
static void items_append(QQmlListProperty< QQuickLabsPlatformMenuItem > *property, QQuickLabsPlatformMenuItem *item)
Q_REVISION(1, 1) void iconChanged()
QQuickLabsPlatformMenuBar * menuBar() const
\readonly \qmlproperty MenuBar Qt.labs.platform::Menu::menuBar
bool isVisible() const
\qmlproperty bool Qt.labs.platform::Menu::visible
Q_INVOKABLE void insertItem(int index, QQuickLabsPlatformMenuItem *item)
\qmlmethod void Qt.labs.platform::Menu::insertItem(int index, MenuItem item)
QFont font() const
\qmlproperty font Qt.labs.platform::Menu::font
static void items_clear(QQmlListProperty< QQuickLabsPlatformMenuItem > *property)
QString title() const
\qmlproperty string Qt.labs.platform::Menu::title
Q_INVOKABLE void removeMenu(QQuickLabsPlatformMenu *menu)
\qmlmethod void Qt.labs.platform::Menu::removeMenu(Menu submenu)
static qsizetype data_count(QQmlListProperty< QObject > *property)
QQuickLabsPlatformIcon icon() const
QQuickLabsPlatformIconLoader * iconLoader() const
QQuickLabsPlatformMenu * parentMenu() const
\readonly \qmlproperty Menu Qt.labs.platform::Menu::parentMenu
Q_INVOKABLE void addMenu(QQuickLabsPlatformMenu *menu)
\qmlmethod void Qt.labs.platform::Menu::addMenu(Menu submenu)
Q_INVOKABLE void removeItem(QQuickLabsPlatformMenuItem *item)
\qmlmethod void Qt.labs.platform::Menu::removeItem(MenuItem item)
void setIcon(const QQuickLabsPlatformIcon &icon)
static qsizetype items_count(QQmlListProperty< QQuickLabsPlatformMenuItem > *property)
Q_INVOKABLE void clear()
\qmlmethod void Qt.labs.platform::Menu::clear()
void setFont(const QFont &font)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
Q_INVOKABLE void addItem(QQuickLabsPlatformMenuItem *item)
\qmlmethod void Qt.labs.platform::Menu::addItem(MenuItem item)
void setType(QPlatformMenu::MenuType type)
static void data_append(QQmlListProperty< QObject > *property, QObject *object)
QQmlListProperty< QObject > data()
Q_INVOKABLE void insertMenu(int index, QQuickLabsPlatformMenu *menu)
\qmlmethod void Qt.labs.platform::Menu::insertMenu(int index, Menu submenu)
int minimumWidth() const
\qmlproperty int Qt.labs.platform::Menu::minimumWidth
QPlatformMenu::MenuType type() const
\qmlproperty enumeration Qt.labs.platform::Menu::type
QQuickLabsPlatformMenuItem * menuItem() const
\readonly \qmlproperty MenuItem Qt.labs.platform::Menu::menuItem
QQmlListProperty< QQuickLabsPlatformMenuItem > items()
static void data_clear(QQmlListProperty< QObject > *property)
QPlatformMenu * handle() const
void close()
\qmlmethod void Qt.labs.platform::Menu::close()
bool isEnabled() const
\qmlproperty bool Qt.labs.platform::Menu::enabled
void classBegin() override
Invoked after class creation, but before any properties have been set.
void setMenuBar(QQuickLabsPlatformMenuBar *menuBar)
void setTitle(const QString &title)
void setParentMenu(QQuickLabsPlatformMenu *menu)
QWindow * findWindow(QQuickItem *target, QPoint *offset) const
static QWindow * effectiveWindow(QWindow *window, QPoint *offset)