Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qquickpalettecolorprovider_p.h
Go to the documentation of this file.
1
// Copyright (C) 2020 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
#
ifndef
QQUICKPALETTECOLORPROVIDER_P_H
5
#
define
QQUICKPALETTECOLORPROVIDER_P_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
<
QtGui
/
QPalette
>
19
20
#
include
<
QtQuick
/
qtquickglobal
.
h
>
21
22
#
include
<
QtQuick
/
private
/
qtquickglobal_p
.
h
>
23
#
include
<
private
/
qlazilyallocated_p
.
h
>
24
25
QT_BEGIN_NAMESPACE
26
27
class
QQuickAbstractPaletteProvider;
28
29
class
Q_QUICK_EXPORT
QQuickPaletteColorProvider
30
:
public
std::enable_shared_from_this<QQuickPaletteColorProvider>
31
{
32
public
:
33
QQuickPaletteColorProvider();
34
35
const
QColor &color(QPalette::ColorGroup group, QPalette::ColorRole role)
const
;
36
bool
setColor(QPalette::ColorGroup group, QPalette::ColorRole role, QColor color);
37
bool
resetColor(QPalette::ColorGroup group, QPalette::ColorRole role);
38
bool
resetColor(QPalette::ColorGroup group);
39
40
bool
fromQPalette(QPalette p);
41
QPalette palette()
const
;
42
43
const
QQuickAbstractPaletteProvider *paletteProvider()
const
;
44
void
setPaletteProvider(
const
QQuickAbstractPaletteProvider *paletteProvider);
45
46
bool
copyColorGroup(QPalette::ColorGroup cg,
const
QQuickPaletteColorProvider &p);
47
48
bool
reset();
49
50
bool
inheritPalette(
const
QPalette &palette);
51
52
private
:
53
bool
doInheritPalette(
const
QPalette &palette);
54
bool
updateInheritedPalette();
55
void
ensureRequestedPalette();
56
57
QPalette m_resolvedPalette;
58
QLazilyAllocated<QPalette> m_requestedPalette;
59
QLazilyAllocated<QPalette> m_lastInheritedPalette;
60
61
using
Deleter = std::function<
void
(
const
QQuickAbstractPaletteProvider*)>;
62
using
ProviderPtr = std::unique_ptr<
const
QQuickAbstractPaletteProvider, Deleter>;
63
ProviderPtr m_paletteProvider;
64
};
65
66
QT_END_NAMESPACE
67
68
#
endif
// QQUICKPALETTECOLORPROVIDER_P_H
DefaultPalettesProvider
Definition
qquickpalettecolorprovider.cpp:22
DefaultPalettesProvider::defaultPalette
QPalette defaultPalette() const override
Definition
qquickpalettecolorprovider.cpp:24
QQuickPaletteColorProvider
Definition
qquickpalettecolorprovider_p.h:31
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
defaultDeleter
static std::default_delete< const QQuickAbstractPaletteProvider > defaultDeleter()
Definition
qquickpalettecolorprovider.cpp:27
adjustCg
static QPalette::ColorGroup adjustCg(QPalette::ColorGroup group)
Definition
qquickpalettecolorprovider.cpp:16
notEq
static QT_BEGIN_NAMESPACE bool notEq(const QPalette &p1, const QPalette &p2)
Definition
qquickpalettecolorprovider.cpp:11
qtdeclarative
src
quick
items
qquickpalettecolorprovider_p.h
Generated on
for Qt by
1.18.0