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
7QT_BEGIN_NAMESPACE
8
9using namespace Qt::StringLiterals;
10
11class QXdgDesktopPortalThemePlugin : public QPlatformThemePlugin
12{
13 Q_OBJECT
14 Q_PLUGIN_METADATA(IID QPlatformThemeFactoryInterface_iid FILE "xdgdesktopportal.json")
15
16public:
17 QPlatformTheme *create(const QString &key, const QStringList &params) override;
18};
19
20QPlatformTheme *QXdgDesktopPortalThemePlugin::create(const QString &key, const QStringList &params)
21{
22 Q_UNUSED(params);
23 if (!key.compare(other: "xdgdesktopportal"_L1, cs: Qt::CaseInsensitive) ||
24 !key.compare(other: "flatpak"_L1, cs: Qt::CaseInsensitive) ||
25 !key.compare(other: "snap"_L1, cs: Qt::CaseInsensitive))
26 return new QXdgDesktopPortalTheme;
27
28 return nullptr;
29}
30
31QT_END_NAMESPACE
32
33#include "main.moc"
34

source code of qtbase/src/plugins/platformthemes/xdgdesktopportal/main.cpp