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
qquickstyleconstants.mm
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
4
#
include
"qquickstyleconstants_p.h"
5
6
#
include
<
private
/
qcore_mac_p
.
h
>
7
#
include
<
private
/
qcoregraphics_p
.
h
>
8
9
#
include
<
QtGui
/
qguiapplication
.
h
>
10
#
include
<
QtGui
/
qstylehints
.
h
>
11
12
#
include
<
AppKit
/
AppKit
.
h
>
13
14
QT_BEGIN_NAMESPACE
15
16
using
namespace
Qt::StringLiterals;
17
18
QQuickStyleConstants::QQuickStyleConstants()
19
{
20
connect(QGuiApplication::styleHints(), &QStyleHints::colorSchemeChanged, [=]{
21
emit secondarySystemFillColorChanged();
22
emit tertiarySystemFillColorChanged();
23
});
24
}
25
26
bool
QQuickStyleConstants::runningWithLiquidGlass()
const
27
{
28
return
qt_apple_runningWithLiquidGlass();
29
}
30
31
static
QColor
systemColor
(std::function<NSColor *()> block)
32
{
33
__block QColor color;
34
[NSApp.effectiveAppearance performAsCurrentDrawingAppearance:^{
35
color = qt_mac_toQBrush(block()).color();
36
}];
37
return
color;
38
}
39
40
QColor QQuickStyleConstants::secondarySystemFillColor()
const
41
{
42
#
if
QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE
(
140000
)
43
if
(@available(macOS 14.0, *))
44
return
systemColor([]{
return
NSColor.secondarySystemFillColor; });
45
#
endif
46
return
Qt::black;
47
}
48
49
QColor QQuickStyleConstants::tertiarySystemFillColor()
const
50
{
51
#
if
QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE
(
140000
)
52
if
(@available(macOS 14.0, *))
53
return
systemColor([]{
return
NSColor.tertiarySystemFillColor; });
54
#
endif
55
return
Qt::black;
56
}
57
58
QT_END_NAMESPACE
59
60
#
include
"moc_qquickstyleconstants_p.cpp"
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qrandomaccessasyncfile_darwin.mm:17
systemColor
static QColor systemColor(std::function< NSColor *()> block)
Definition
qquickstyleconstants.mm:31
qtdeclarative
src
quickcontrols
quicknativestyle
util
qquickstyleconstants.mm
Generated on
for Qt by
1.16.1