Qt
6.x
The Qt SDK
Loading...
Searching...
No Matches
qquicklabsplatformmenuitemgroup_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
4
#ifndef QQUICKLABSPLATFORMMENUITEMGROUP_P_H
5
#define QQUICKLABSPLATFORMMENUITEMGROUP_P_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists purely as an
12
// implementation detail. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
#include <QtCore/qobject.h>
19
#include <QtCore/qlist.h>
20
#include <QtQml/qqml.h>
21
#include <QtCore/private/qglobal_p.h>
22
23
QT_BEGIN_NAMESPACE
24
25
class
QQuickLabsPlatformMenuItem
;
26
class
QQuickLabsPlatformMenuItemGroupPrivate;
27
28
class
QQuickLabsPlatformMenuItemGroup
:
public
QObject
29
{
30
Q_OBJECT
31
QML_NAMED_ELEMENT
(MenuItemGroup)
32
Q_PROPERTY
(
bool
enabled
READ
isEnabled
WRITE
setEnabled
NOTIFY
enabledChanged
FINAL)
33
Q_PROPERTY
(
bool
visible
READ
isVisible
WRITE
setVisible
NOTIFY
visibleChanged
FINAL)
34
Q_PROPERTY
(
bool
exclusive
READ
isExclusive
WRITE
setExclusive
NOTIFY
exclusiveChanged
FINAL)
35
Q_PROPERTY
(
QQuickLabsPlatformMenuItem
*
checkedItem
READ
checkedItem
WRITE
setCheckedItem
NOTIFY
checkedItemChanged
FINAL)
36
Q_PROPERTY
(
QQmlListProperty<QQuickLabsPlatformMenuItem>
items
READ
items
NOTIFY
itemsChanged
FINAL)
37
38
public
:
39
explicit
QQuickLabsPlatformMenuItemGroup
(
QObject
*
parent
=
nullptr
);
40
~QQuickLabsPlatformMenuItemGroup
();
41
42
bool
isEnabled
()
const
;
43
void
setEnabled
(
bool
enabled
);
44
45
bool
isVisible
()
const
;
46
void
setVisible
(
bool
visible
);
47
48
bool
isExclusive
()
const
;
49
void
setExclusive
(
bool
exclusive
);
50
51
QQuickLabsPlatformMenuItem
*
checkedItem
()
const
;
52
void
setCheckedItem
(
QQuickLabsPlatformMenuItem
*
item
);
53
54
QQmlListProperty<QQuickLabsPlatformMenuItem>
items
();
55
56
Q_INVOKABLE
void
addItem
(
QQuickLabsPlatformMenuItem
*
item
);
57
Q_INVOKABLE
void
removeItem
(
QQuickLabsPlatformMenuItem
*
item
);
58
Q_INVOKABLE
void
clear
();
59
60
Q_SIGNALS
:
61
void
triggered
(
QQuickLabsPlatformMenuItem
*
item
);
62
void
hovered
(
QQuickLabsPlatformMenuItem
*
item
);
63
64
void
enabledChanged
();
65
void
visibleChanged
();
66
void
exclusiveChanged
();
67
void
checkedItemChanged
();
68
void
itemsChanged
();
69
70
private
:
71
QQuickLabsPlatformMenuItem
*findCurrent()
const
;
72
void
updateCurrent();
73
void
activateItem();
74
void
hoverItem();
75
76
static
void
items_append(
QQmlListProperty<QQuickLabsPlatformMenuItem>
*prop,
QQuickLabsPlatformMenuItem
*
obj
);
77
static
qsizetype
items_count(
QQmlListProperty<QQuickLabsPlatformMenuItem>
*prop);
78
static
QQuickLabsPlatformMenuItem
*items_at(
QQmlListProperty<QQuickLabsPlatformMenuItem>
*prop,
qsizetype
index
);
79
static
void
items_clear(
QQmlListProperty<QQuickLabsPlatformMenuItem>
*prop);
80
81
bool
m_enabled;
82
bool
m_visible;
83
bool
m_exclusive;
84
QQuickLabsPlatformMenuItem
*m_checkedItem;
85
QList<QQuickLabsPlatformMenuItem*>
m_items;
86
};
87
88
QT_END_NAMESPACE
89
90
QML_DECLARE_TYPE
(
QQuickLabsPlatformMenuItemGroup
)
91
92
#endif
// QQUICKLABSPLATFORMMENUITEMGROUP_P_H
QList
Definition
qlist.h:74
QObject
\inmodule QtCore
Definition
qobject.h:90
QObject::parent
QObject * parent() const
Returns a pointer to the parent object.
Definition
qobject.h:311
QQmlListProperty
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
Definition
qqmllist.h:24
QQuickLabsPlatformMenuItemGroup
Definition
qquicklabsplatformmenuitemgroup_p.h:29
QQuickLabsPlatformMenuItemGroup::checkedItemChanged
void checkedItemChanged()
QQuickLabsPlatformMenuItemGroup::items
QQmlListProperty< QQuickLabsPlatformMenuItem > items
\qmlproperty list<MenuItem> Qt.labs.platform::MenuItemGroup::items
Definition
qquicklabsplatformmenuitemgroup_p.h:36
QQuickLabsPlatformMenuItemGroup::visibleChanged
void visibleChanged()
QQuickLabsPlatformMenuItemGroup::setExclusive
void setExclusive(bool exclusive)
Definition
qquicklabsplatformmenuitemgroup.cpp:184
QQuickLabsPlatformMenuItemGroup::enabledChanged
void enabledChanged()
QQuickLabsPlatformMenuItemGroup::removeItem
Q_INVOKABLE void removeItem(QQuickLabsPlatformMenuItem *item)
\qmlmethod void Qt.labs.platform::MenuItemGroup::removeItem(MenuItem item)
Definition
qquicklabsplatformmenuitemgroup.cpp:259
QQuickLabsPlatformMenuItemGroup::clear
Q_INVOKABLE void clear()
\qmlmethod void Qt.labs.platform::MenuItemGroup::clear()
Definition
qquicklabsplatformmenuitemgroup.cpp:282
QQuickLabsPlatformMenuItemGroup::setCheckedItem
void setCheckedItem(QQuickLabsPlatformMenuItem *item)
Definition
qquicklabsplatformmenuitemgroup.cpp:206
QQuickLabsPlatformMenuItemGroup::setEnabled
void setEnabled(bool enabled)
Definition
qquicklabsplatformmenuitemgroup.cpp:126
QQuickLabsPlatformMenuItemGroup::hovered
void hovered(QQuickLabsPlatformMenuItem *item)
QQuickLabsPlatformMenuItemGroup::triggered
void triggered(QQuickLabsPlatformMenuItem *item)
QQuickLabsPlatformMenuItemGroup::exclusive
bool exclusive
Definition
qquicklabsplatformmenuitemgroup_p.h:34
QQuickLabsPlatformMenuItemGroup::~QQuickLabsPlatformMenuItemGroup
~QQuickLabsPlatformMenuItemGroup()
Definition
qquicklabsplatformmenuitemgroup.cpp:108
QQuickLabsPlatformMenuItemGroup::isEnabled
bool isEnabled() const
\qmlproperty bool Qt.labs.platform::MenuItemGroup::enabled
Definition
qquicklabsplatformmenuitemgroup.cpp:121
QQuickLabsPlatformMenuItemGroup::isVisible
bool isVisible() const
\qmlproperty bool Qt.labs.platform::MenuItemGroup::visible
Definition
qquicklabsplatformmenuitemgroup.cpp:150
QQuickLabsPlatformMenuItemGroup::itemsChanged
void itemsChanged()
QQuickLabsPlatformMenuItemGroup::visible
bool visible
Definition
qquicklabsplatformmenuitemgroup_p.h:33
QQuickLabsPlatformMenuItemGroup::checkedItem
QQuickLabsPlatformMenuItem * checkedItem
Definition
qquicklabsplatformmenuitemgroup_p.h:35
QQuickLabsPlatformMenuItemGroup::addItem
Q_INVOKABLE void addItem(QQuickLabsPlatformMenuItem *item)
\qmlmethod void Qt.labs.platform::MenuItemGroup::addItem(MenuItem item)
Definition
qquicklabsplatformmenuitemgroup.cpp:236
QQuickLabsPlatformMenuItemGroup::setVisible
void setVisible(bool visible)
Definition
qquicklabsplatformmenuitemgroup.cpp:155
QQuickLabsPlatformMenuItemGroup::items
QQmlListProperty< QQuickLabsPlatformMenuItem > items()
QQuickLabsPlatformMenuItemGroup::isExclusive
bool isExclusive() const
\qmlproperty bool Qt.labs.platform::MenuItemGroup::exclusive
Definition
qquicklabsplatformmenuitemgroup.cpp:179
QQuickLabsPlatformMenuItemGroup::exclusiveChanged
void exclusiveChanged()
QQuickLabsPlatformMenuItem
Definition
qquicklabsplatformmenuitem_p.h:35
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
index
GLuint index
[2]
Definition
qopengles2ext.h:331
enabled
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition
qopengles2ext.h:150
obj
GLhandleARB obj
[2]
Definition
qopenglext.h:4164
QML_DECLARE_TYPE
#define QML_DECLARE_TYPE(TYPE)
Definition
qqml.h:19
QML_NAMED_ELEMENT
#define QML_NAMED_ELEMENT(NAME)
Definition
qqmlintegration.h:52
Q_PROPERTY
#define Q_PROPERTY(...)
Definition
qtmetamacros.h:56
Q_OBJECT
#define Q_OBJECT
Definition
qtmetamacros.h:117
Q_INVOKABLE
#define Q_INVOKABLE
Definition
qtmetamacros.h:76
Q_SIGNALS
#define Q_SIGNALS
Definition
qtmetamacros.h:45
qsizetype
ptrdiff_t qsizetype
Definition
qtypes.h:70
item
QGraphicsItem * item
Definition
src_gui_graphicsview_qgraphicsitem.cpp:107
qtdeclarative
src
labs
platform
qquicklabsplatformmenuitemgroup_p.h
Generated by
1.9.7