MauiKit Controls

controls.h
1#pragma once
2
3#include <QObject>
4#include <QQmlEngine>
5
6/**
7 * @brief The Controls class.
8 *
9 * This object exposes a series of attached properties useful for the MauiKit controls.
10 *
11 * @note This is mean to be used as an attached property. It can be consumed as `Maui.Controls`, for example, `Maui.Controls.showCSD`
12 */
13class Controls : public QObject
14{
16 QML_ELEMENT
17 QML_ATTACHED(Controls)
18 QML_UNCREATABLE("Cannot be created Controls")
19
20 /**
21 * A title text that can be attached to any control.
22 */
23 Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
24
25 /**
26 * Whether a supported MauiKit controls should display the window control buttons when using CSD.
27 */
28 Q_PROPERTY(bool showCSD READ showCSD WRITE setShowCSD NOTIFY showCSDChanged)
29
30public:
31 explicit Controls(QObject *parent = nullptr);
32
33 static Controls *qmlAttachedProperties(QObject *object);
34
35 bool showCSD() const;
36 void setShowCSD(bool newShowCSD);
37
38 QString title() const;
39 void setTitle(const QString &title);
40
42 void titleChanged();
43 void showCSDChanged();
44
45private:
46 bool m_showCSD;
47 QString m_title;
48};
49
The Controls class.
Definition controls.h:14
QML_ELEMENTQString title
A title text that can be attached to any control.
Definition controls.h:23
bool showCSD
Whether a supported MauiKit controls should display the window control buttons when using CSD.
Definition controls.h:28
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:47:05 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.