MauiKit Controls

controls.cpp
1#include "controls.h"
2
3Controls::Controls(QObject *parent)
4 : QObject{parent}
5{
6
7}
8
9Controls *Controls::qmlAttachedProperties(QObject *object)
10{
11 Q_UNUSED(object)
12
13 return new Controls(object);
14}
15
16bool Controls::showCSD() const
17{
18 return m_showCSD;
19}
20
21void Controls::setShowCSD(bool newShowCSD)
22{
23 if (m_showCSD == newShowCSD)
24 return;
25
26 m_showCSD = newShowCSD;
27 Q_EMIT showCSDChanged();
28}
29
31{
32 return m_title;
33}
34
35void Controls::setTitle(const QString &title)
36{
37 if (m_title == title)
38 return;
39
40 m_title = title;
41 Q_EMIT titleChanged();
42}
43
45{
46 return m_subtitle;
47}
48
49void Controls::setSubtitle(const QString &subtitle)
50{
51 if (m_subtitle == subtitle)
52 return;
53
54 m_subtitle = subtitle;
55 Q_EMIT subtitleChanged();
56}
57
59{
60 return m_iconName;
61}
62
63void Controls::setIconName(const QString &newIconName)
64{
65 if (m_iconName == newIconName)
66 return;
67
68 m_iconName = newIconName;
69 Q_EMIT iconNameChanged();
70}
71
73{
74 return m_badgeText;
75}
76
77void Controls::setBadgeText(const QString &newBadgeText)
78{
79 if (m_badgeText == newBadgeText)
80 return;
81
82 m_badgeText = newBadgeText;
83 Q_EMIT badgeTextChanged();
84}
85
87{
88 return m_toolTipText;
89}
90
91void Controls::setToolTipText(const QString &newToolTipText)
92{
93 if (m_toolTipText == newToolTipText)
94 return;
95
96 m_toolTipText = newToolTipText;
97 Q_EMIT toolTipTextChanged();
98}
99
101{
102 return m_color;
103}
104
105void Controls::setColor(const QString &newColor)
106{
107 if (m_color == newColor)
108 return;
109
110 m_color = newColor;
111 Q_EMIT colorChanged();
112}
113
114
115Controls::Level Controls::level() const
116{
117 return m_level;
118}
119
120void Controls::setLevel(Controls::Level level)
121{
122 if(m_level == level)
123 return;
124
125 m_level = level;
126 Q_EMIT levelChanged();
127}
128
129bool Controls::flat() const
130{
131 return m_flat;
132}
133
134void Controls::setFlat(bool value)
135{
136 if(m_flat == value)
137 return;
138
139 m_flat = value;
140 Q_EMIT flatChanged();
141}
142
143Controls::Status Controls::status() const
144{
145 return m_status;
146}
147
148void Controls::setStatus(Status status)
149{
150 if(m_status == status)
151 return;
152
153 m_status = status;
154 Q_EMIT statusChanged();
155}
156
158{
159 return m_component;
160}
161
162void Controls::setComponent(QQmlComponent *component)
163{
164 if(m_component == component)
165 return;
166
167 m_component = component;
168 Q_EMIT componentChanged();
169}
170
171QQuickItem *Controls::item() const
172{
173 return m_item;
174}
175
176void Controls::setItem(QQuickItem *item)
177{
178 if(m_item == item)
179 return;
180
181 m_item = item;
182 Q_EMIT itemChanged();
183}
184
185void Controls::setOrientation(Qt::Orientation orientation)
186{
187 if(m_orientation == orientation)
188 return;
189
190 m_orientation = orientation;
191 Q_EMIT orientationChanged();
192}
193
194Qt::Orientation Controls::orientation() const
195{
196 return m_orientation;
197}
The Controls class.
Definition controls.h:18
QQmlComponent * component
Some controls might depend of a custom Component to be rendered.
Definition controls.h:201
QString toolTipText
The text to be shown in the tool-tip when hovering over the tab button representing the view.
Definition controls.h:75
QML_ELEMENTQString title
A title text that can be attached to any control.
Definition controls.h:30
QString iconName
The icon name to be used in or by the widget.
Definition controls.h:43
QString badgeText
The text to be used as a badge for notification purposes.
Definition controls.h:60
Status status
Mark the supported widget in one of the given status, which will alterate its look.
Definition controls.h:190
QString color
The color to be used as an indicator in the supported widgets.
Definition controls.h:70
QString subtitle
A subtitle text that can be attached to any control.
Definition controls.h:38
bool showCSD
Whether a supported MauiKit control should display the window control buttons when using client side ...
Definition controls.h:85
Level level
Set a UI element hierarchy level.
Definition controls.h:125
bool flat
A property hint for UI elements to be styled as a flat surface, for example, without a background.
Definition controls.h:132
Q_SCRIPTABLE CaptureState status()
Q_EMITQ_EMIT
Orientation
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 25 2025 11:53:32 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.