1// Copyright (C) 2016 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 QQUICKSYSTEMPALETTE_H
5#define QQUICKSYSTEMPALETTE_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 <private/qtquickglobal_p.h>
19
20#include <QtCore/qobject.h>
21
22#include <QtGui/qpalette.h>
23
24#include <QtQml/qqml.h>
25
26QT_BEGIN_NAMESPACE
27
28class QQuickSystemPalettePrivate;
29class Q_QUICK_EXPORT QQuickSystemPalette : public QObject
30{
31 Q_OBJECT
32 Q_DECLARE_PRIVATE(QQuickSystemPalette)
33
34 Q_PROPERTY(QQuickSystemPalette::ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY paletteChanged)
35 Q_PROPERTY(QColor window READ window NOTIFY paletteChanged)
36 Q_PROPERTY(QColor windowText READ windowText NOTIFY paletteChanged)
37 Q_PROPERTY(QColor base READ base NOTIFY paletteChanged)
38 Q_PROPERTY(QColor text READ text NOTIFY paletteChanged)
39 Q_PROPERTY(QColor alternateBase READ alternateBase NOTIFY paletteChanged)
40 Q_PROPERTY(QColor button READ button NOTIFY paletteChanged)
41 Q_PROPERTY(QColor buttonText READ buttonText NOTIFY paletteChanged)
42 Q_PROPERTY(QColor light READ light NOTIFY paletteChanged)
43 Q_PROPERTY(QColor midlight READ midlight NOTIFY paletteChanged)
44 Q_PROPERTY(QColor dark READ dark NOTIFY paletteChanged)
45 Q_PROPERTY(QColor mid READ mid NOTIFY paletteChanged)
46 Q_PROPERTY(QColor shadow READ shadow NOTIFY paletteChanged)
47 Q_PROPERTY(QColor highlight READ highlight NOTIFY paletteChanged)
48 Q_PROPERTY(QColor highlightedText READ highlightedText NOTIFY paletteChanged)
49 Q_PROPERTY(QColor placeholderText READ placeholderText NOTIFY paletteChanged REVISION(6, 2))
50 Q_PROPERTY(QColor accent READ accent NOTIFY paletteChanged REVISION(6, 7) FINAL)
51 QML_NAMED_ELEMENT(SystemPalette)
52 QML_ADDED_IN_VERSION(2, 0)
53
54public:
55 QQuickSystemPalette(QObject *parent=nullptr);
56
57 enum ColorGroup { Active = QPalette::Active, Inactive = QPalette::Inactive, Disabled = QPalette::Disabled };
58 Q_ENUM(ColorGroup)
59
60 QColor window() const;
61 QColor windowText() const;
62
63 QColor base() const;
64 QColor text() const;
65 QColor alternateBase() const;
66
67 QColor button() const;
68 QColor buttonText() const;
69
70 QColor light() const;
71 QColor midlight() const;
72 QColor dark() const;
73 QColor mid() const;
74 QColor shadow() const;
75
76 QColor highlight() const;
77 QColor highlightedText() const;
78
79 QColor placeholderText() const;
80 QColor accent() const;
81
82 QQuickSystemPalette::ColorGroup colorGroup() const;
83 void setColorGroup(QQuickSystemPalette::ColorGroup);
84
85Q_SIGNALS:
86 void paletteChanged();
87};
88
89QT_END_NAMESPACE
90
91#endif // QQUICKSYSTEMPALETTE_H
92

Provided by KDAB

Privacy Policy
Start learning QML with our Intro Training
Find out more

source code of qtdeclarative/src/quick/util/qquicksystempalette_p.h