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