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
qqstylekitcontrolstate_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 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 QQSTYLEKITCONTROLSTATE_P_H
6#define QQSTYLEKITCONTROLSTATE_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 <QtQml/QtQml>
20
22
24
25class QQStyleKitControl;
26
27class Q_LABSSTYLEKIT_EXPORT QQStyleKitControlState : public QQStyleKitControlProperties
28{
29 Q_OBJECT
30 Q_PROPERTY(QQStyleKitControlState *pressed READ pressed NOTIFY pressedChanged FINAL)
31 Q_PROPERTY(QQStyleKitControlState *hovered READ hovered NOTIFY hoveredChanged FINAL)
32 Q_PROPERTY(QQStyleKitControlState *focused READ focused NOTIFY focusedChanged FINAL)
33 Q_PROPERTY(QQStyleKitControlState *checked READ checked NOTIFY checkedChanged FINAL)
34 Q_PROPERTY(QQStyleKitControlState *disabled READ disabled NOTIFY disabledChanged FINAL)
35 Q_PROPERTY(QQStyleKitControlState *highlighted READ highlighted NOTIFY highlightedChanged FINAL)
36 Q_PROPERTY(QQStyleKitControlState *vertical READ vertical NOTIFY verticalChanged FINAL)
37 QML_NAMED_ELEMENT(ControlStateStyle)
38
39public:
40 QQStyleKitControlState(QObject *parent = nullptr);
41
42 QQStyleKitControlState *pressed() const;
43 QQStyleKitControlState *hovered() const;
44 QQStyleKitControlState *focused() const;
45 QQStyleKitControlState *checked() const;
46 QQStyleKitControlState *disabled() const;
47 QQStyleKitControlState *highlighted() const;
48 QQStyleKitControlState *vertical() const;
49
50 QQStyleKitControl *control() const;
51 inline QQSK::State nestedState() const { return m_nestedState; }
52
53signals:
54 void pressedChanged();
55 void hoveredChanged();
56 void focusedChanged();
57 void checkedChanged();
58 void disabledChanged();
59 void highlightedChanged();
60 void verticalChanged();
61
62private:
63 Q_DISABLE_COPY(QQStyleKitControlState)
64 QQStyleKitControlState *lazyCreateState(QQSK::StateFlag state) const;
65
66private:
67 QMap<QQSK::StateFlag, QQStyleKitControlState *> m_nestedStateObjects;
68 QQSK::State m_nestedState = QQSK::StateFlag::Normal;
69};
70
71QT_END_NAMESPACE
72
73#endif // QQSTYLEKITCONTROLSTATE_P_H
Combined button and popup list for selecting options.