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
qquickfusionstyle_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 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 QQUICKFUSIONSTYLE_P_H
6#define QQUICKFUSIONSTYLE_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 <QtCore/qobject.h>
20#include <QtGui/qcolor.h>
21#include <QtQml/qqml.h>
22#include <QtQuickControls2Fusion/qtquickcontrols2fusionexports.h>
23
24QT_BEGIN_NAMESPACE
25
26class QQuickPalette;
27
28class Q_QUICKCONTROLS2FUSION_EXPORT QQuickFusionStyle : public QObject
29{
30 Q_OBJECT
31 Q_PROPERTY(QColor lightShade READ lightShade CONSTANT FINAL)
32 Q_PROPERTY(QColor darkShade READ darkShade CONSTANT FINAL)
33 Q_PROPERTY(QColor topShadow READ topShadow CONSTANT FINAL)
34 Q_PROPERTY(QColor innerContrastLine READ innerContrastLine CONSTANT FINAL)
35 Q_PROPERTY(bool highContrast READ isHighContrast NOTIFY highContrastChanged FINAL REVISION(6, 10))
36 QML_NAMED_ELEMENT(Fusion)
37 QML_SINGLETON
38 QML_ADDED_IN_VERSION(2, 3)
39
40public:
41 explicit QQuickFusionStyle(QObject *parent = nullptr);
42
43 static QColor lightShade();
44 static QColor darkShade();
45 static QColor topShadow();
46 static QColor innerContrastLine();
47 static bool isHighContrast();
48
49 Q_INVOKABLE static QColor highlight(QQuickPalette *palette);
50 Q_INVOKABLE static QColor highlightedText(QQuickPalette *palette);
51 Q_INVOKABLE static QColor outline(QQuickPalette *palette);
52 Q_INVOKABLE static QColor highlightedOutline(QQuickPalette *palette);
53 Q_INVOKABLE static QColor tabFrameColor(QQuickPalette *palette);
54 Q_INVOKABLE static QColor buttonColor(QQuickPalette *palette, bool highlighted = false, bool down = false, bool hovered = false);
55 Q_INVOKABLE static QColor buttonOutline(QQuickPalette *palette, bool highlighted = false, bool enabled = true);
56 Q_INVOKABLE static QColor gradientStart(const QColor &baseColor);
57 Q_INVOKABLE static QColor gradientStop(const QColor &baseColor);
58 Q_INVOKABLE static QColor mergedColors(const QColor &colorA, const QColor &colorB, int factor = 50);
59 Q_INVOKABLE static QColor grooveColor(QQuickPalette *palette);
60
61Q_SIGNALS:
62 Q_REVISION(6, 10) void highContrastChanged();
63};
64
65QT_END_NAMESPACE
66
67#endif // QQUICKFUSIONSTYLE_P_H