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
qandroidplatformmenuitem.cpp
Go to the documentation of this file.
1// Copyright (C) 2012 BogDan Vatra <bogdan@kde.org>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
6
8
10{
11 m_menu = 0;
12 m_isVisible = true;
13 m_isSeparator = false;
14 m_role = NoRole;
15 m_isCheckable = false;
16 m_isChecked = false;
17 m_isEnabled = true;
18}
19
21{
22 m_text = text;
23 if (m_menu)
24 m_menu->setText(m_text);
25}
26
28{
29 return m_text;
30}
31
33{
34 m_icon = icon;
35 if (m_menu)
36 m_menu->setIcon(m_icon);
37}
38
40{
41 return m_icon;
42}
43
45{
46 m_menu = static_cast<QAndroidPlatformMenu *>(menu);
47 if (!m_menu)
48 return;
49
50 m_menu->setText(m_text);
51 m_menu->setIcon(m_icon);
52 m_menu->setVisible(m_isVisible);
53 m_menu->setEnabled(m_isEnabled);
54}
55
57{
58 return m_menu;
59}
60
62{
63 m_isVisible = isVisible;
64 if (m_menu)
65 m_menu->setVisible(m_isVisible);
66}
67
69{
70 return m_isVisible;
71}
72
77
79{
80 return m_isSeparator;
81}
82
87
92
97
99{
100 m_isCheckable = checkable;
101}
102
104{
105 return m_isCheckable;
106}
107
109{
110 m_isChecked = isChecked;
111}
112
114{
115 return m_isChecked;
116}
117
122
124{
125 m_isEnabled = enabled;
126 if (m_menu)
127 m_menu->setEnabled(m_isEnabled);
128}
129
131{
132 return m_isEnabled;
133}
134
139
void setIsSeparator(bool isSeparator) override
void setShortcut(const QKeySequence &shortcut) override
void setIcon(const QIcon &icon) override
void setRole(MenuRole role) override
void setEnabled(bool enabled) override
void setFont(const QFont &font) override
QAndroidPlatformMenu * menu() const
void setCheckable(bool checkable) override
void setText(const QString &text) override
void setMenu(QPlatformMenu *menu) override
void setChecked(bool isChecked) override
void setIconSize(int size) override
void setVisible(bool isVisible) override
void setIcon(const QIcon &icon) override
void setEnabled(bool enabled) override
void setVisible(bool visible) override
void setText(const QString &text) override
\reentrant
Definition qfont.h:22
The QIcon class provides scalable icons in different modes and states.
Definition qicon.h:20
The QKeySequence class encapsulates a key sequence as used by shortcuts.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QString text
Combined button and popup list for selecting options.
static bool isSeparator(char c)
Definition qhsts.cpp:280
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei const GLuint GLboolean enabled
#define Q_UNUSED(x)
#define enabled
edit isVisible()
QMenu menu
[5]