/src/qtbase/src/gui/kernel/qplatformintegrationfactory.cpp
Line | Count | Source |
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 | | // Qt-Security score:significant reason:default |
4 | | |
5 | | #include <qpa/qplatformintegrationfactory_p.h> |
6 | | #include <qpa/qplatformintegrationplugin.h> |
7 | | #include "private/qfactoryloader_p.h" |
8 | | #include "qmutex.h" |
9 | | #include "qdir.h" |
10 | | |
11 | | #include "qguiapplication.h" |
12 | | #include "qdebug.h" |
13 | | |
14 | | QT_BEGIN_NAMESPACE |
15 | | |
16 | | using namespace Qt::StringLiterals; |
17 | | |
18 | | Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, piLoader, |
19 | | (QPlatformIntegrationFactoryInterface_iid, "/platforms"_L1, Qt::CaseInsensitive)) |
20 | | |
21 | | QPlatformIntegration *QPlatformIntegrationFactory::create(const QString &platform, const QStringList ¶mList, int &argc, char **argv, const QString &platformPluginPath) |
22 | 0 | { |
23 | 0 | piLoader->setExtraSearchPath(platformPluginPath); |
24 | 0 | return qLoadPlugin<QPlatformIntegration, QPlatformIntegrationPlugin>(piLoader(), platform, paramList, argc, argv); |
25 | 0 | } |
26 | | |
27 | | /*! |
28 | | \internal |
29 | | Returns the list of valid keys, i.e. the keys this factory can |
30 | | create styles for. |
31 | | |
32 | | \sa create() |
33 | | */ |
34 | | |
35 | | QStringList QPlatformIntegrationFactory::keys(const QString &platformPluginPath) |
36 | 0 | { |
37 | 0 | piLoader->setExtraSearchPath(platformPluginPath); |
38 | 0 | return piLoader->keyMap().values(); |
39 | 0 | } |
40 | | |
41 | | QT_END_NAMESPACE |
42 | | |