Qt
6.x
The Qt SDK
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1
// Copyright (C) 2017-2018 Red Hat, Inc
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 <qpa/qplatformthemeplugin.h>
5
#include "
qxdgdesktopportaltheme.h
"
6
7
QT_BEGIN_NAMESPACE
8
9
using namespace
Qt::StringLiterals
;
10
11
class
QXdgDesktopPortalThemePlugin
:
public
QPlatformThemePlugin
12
{
13
Q_OBJECT
14
Q_PLUGIN_METADATA
(
IID
QPlatformThemeFactoryInterface_iid
FILE
"xdgdesktopportal.json"
)
15
16
public
:
17
QPlatformTheme
*
create
(
const
QString
&
key
,
const
QStringList
&
params
)
override
;
18
};
19
20
QPlatformTheme
*
QXdgDesktopPortalThemePlugin::create
(
const
QString
&
key
,
const
QStringList
&
params
)
21
{
22
Q_UNUSED
(
params
);
23
if
(!
key
.compare(
"xdgdesktopportal"
_L1,
Qt::CaseInsensitive
) ||
24
!
key
.compare(
"flatpak"
_L1,
Qt::CaseInsensitive
) ||
25
!
key
.compare(
"snap"
_L1,
Qt::CaseInsensitive
))
26
return
new
QXdgDesktopPortalTheme
;
27
28
return
nullptr
;
29
}
30
31
QT_END_NAMESPACE
32
33
#include "main.moc"
QPlatformThemePlugin
The QPlatformThemePlugin class provides an abstraction for theme plugins.
Definition
qplatformthemeplugin.h:27
QPlatformTheme
The QPlatformTheme class allows customizing the UI based on themes.
Definition
qplatformtheme.h:43
QStringList
\inmodule QtCore
QString
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition
qstring.h:127
QXdgDesktopPortalThemePlugin
Definition
main.cpp:12
QXdgDesktopPortalThemePlugin::create
QPlatformTheme * create(const QString &key, const QStringList ¶ms) override
Definition
main.cpp:20
QXdgDesktopPortalTheme
Definition
qxdgdesktopportaltheme.h:14
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
Qt::StringLiterals
Definition
qbytearray.h:716
Qt::CaseInsensitive
@ CaseInsensitive
Definition
qnamespace.h:1257
key
GLuint64 key
Definition
qopengles2ext.h:2268
params
void ** params
Definition
qopengles2ext.h:160
QPlatformThemeFactoryInterface_iid
#define QPlatformThemeFactoryInterface_iid
Definition
qplatformthemeplugin.h:24
QtPluginMetaDataKeys::IID
@ IID
Q_OBJECT
#define Q_OBJECT
Definition
qtmetamacros.h:117
Q_PLUGIN_METADATA
#define Q_PLUGIN_METADATA(x)
Definition
qtmetamacros.h:54
Q_UNUSED
#define Q_UNUSED(x)
Definition
qtpreprocessorsupport.h:20
qxdgdesktopportaltheme.h
create
view create()
qtbase
src
plugins
platformthemes
xdgdesktopportal
main.cpp
Generated by
1.9.7