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
qgnomeportalinterface_p.h
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
// Qt-Security score:significant reason:default
4
5
#
ifndef
QGNOMEPORTALINTERFACE_P_H
6
#
define
QGNOMEPORTALINTERFACE_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
/
qtconfigmacros
.
h
>
20
QT_REQUIRE_CONFIG
(
dbus
);
21
22
#
include
<
QtCore
/
QObject
>
23
#
include
<
QtGui
/
private
/
qdbuslistener_p
.
h
>
24
25
QT_BEGIN_NAMESPACE
26
27
class
Q_GUI_EXPORT
QGnomePortalInterface
:
public
QObject
28
{
29
Q_OBJECT
30
31
public
:
32
QGnomePortalInterface(QObject *parent =
nullptr
);
33
~QGnomePortalInterface() =
default
;
34
35
Qt::ColorScheme colorScheme(Qt::ColorScheme fallback = Qt::ColorScheme::Unknown)
const
;
36
Qt::ContrastPreference contrastPreference(
37
Qt::ContrastPreference fallback = Qt::ContrastPreference::NoPreference)
const
;
38
Qt::MotionPreference motionPreference(
39
Qt::MotionPreference fallback = Qt::MotionPreference::NoPreference)
const
;
40
41
private
:
42
void
querySettings();
43
void
updateColorScheme(Qt::ColorScheme colorScheme);
44
void
updateContrast(Qt::ContrastPreference contrast);
45
void
updateMotion(Qt::MotionPreference motion);
46
47
Q_SIGNALS:
48
void
colorSchemeChanged(Qt::ColorScheme);
49
void
contrastChanged(Qt::ContrastPreference);
50
void
motionChanged(Qt::MotionPreference);
51
void
themeNameChanged(
const
QString &themeName);
52
53
private
Q_SLOTS:
54
void
dbusSettingChanged(QDBusListener::Provider, QDBusListener::Setting,
const
QVariant &value);
55
56
private
:
57
mutable
uint m_version = 0;
// cached version value
58
std::optional<Qt::ColorScheme> m_colorScheme;
59
std::optional<Qt::ContrastPreference> m_contrast;
60
std::optional<Qt::MotionPreference> m_motion;
61
std::unique_ptr<QDBusListener> m_dbus;
62
static
constexpr
QLatin1StringView s_service{
"org.freedesktop.portal.Desktop"
};
63
static
constexpr
QLatin1StringView s_path{
"/org/freedesktop/portal/desktop"
};
64
static
constexpr
QLatin1StringView s_interface{
"org.freedesktop.portal.Settings"
};
65
};
66
67
QT_END_NAMESPACE
68
69
#
endif
// QGNOMEPORTALINTERFACE_P_H
QGnomePortalInterface
Definition
qgnomeportalinterface_p.h:28
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QT_REQUIRE_CONFIG
QT_REQUIRE_CONFIG(dbus)
qtbase
src
gui
platform
unix
qgnomeportalinterface_p.h
Generated on
for Qt by
1.18.0