Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qplatformthemefactory.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 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 <qpa/qplatformthemefactory_p.h>
5#include <qpa/qplatformthemeplugin.h>
6#include <QDir>
7#include "private/qfactoryloader_p.h"
8#include "qmutex.h"
9
10#include "qguiapplication.h"
11#include "qplatformtheme.h"
12#include "qplatformtheme_p.h"
13#include "qdebug.h"
14
16
17using namespace Qt::StringLiterals;
18
21
22QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString &platformPluginPath)
23{
24 QStringList paramList = key.split(u':');
25 const QString platform = paramList.takeFirst().toLower();
26 ptLoader->setExtraSearchPath(platformPluginPath);
27 QPlatformTheme *theme = qLoadPlugin<QPlatformTheme, QPlatformThemePlugin>(ptLoader(), platform, paramList);
28 if (theme)
29 theme->d_func()->name = key;
30 return theme;
31}
32
40{
41 ptLoader->setExtraSearchPath(platformPluginPath);
42 return ptLoader->keyMap().values();
43}
44
static QStringList keys(const QString &platformPluginPath=QString())
Returns the list of valid keys, i.e.
static QPlatformTheme * create(const QString &key, const QString &platformPluginPath=QString())
The QPlatformTheme class allows customizing the UI based on themes.
QString name() const
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QString toLower() const &
Definition qstring.h:435
Combined button and popup list for selecting options.
@ CaseInsensitive
#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS)
GLuint64 key
#define QPlatformThemeFactoryInterface_iid
QT_BEGIN_NAMESPACE Platform platform()