1 | // Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB). |
---|---|
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 "qrendererpluginfactory_p.h" |
5 | |
6 | #include <QtCore/private/qfactoryloader_p.h> |
7 | #include <QtCore/QCoreApplication> |
8 | #include <QtCore/QDir> |
9 | |
10 | #include <Qt3DRender/private/qrendererplugin_p.h> |
11 | |
12 | QT_BEGIN_NAMESPACE |
13 | |
14 | namespace Qt3DRender { |
15 | |
16 | namespace Render { |
17 | |
18 | Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QRendererPluginFactoryInterface_iid, QLatin1String("/renderers"), Qt::CaseInsensitive)) |
19 | |
20 | QStringList QRendererPluginFactory::keys() |
21 | { |
22 | return loader->keyMap().values(); |
23 | } |
24 | |
25 | AbstractRenderer *QRendererPluginFactory::create(const QString &name) |
26 | { |
27 | return qLoadPlugin<AbstractRenderer, QRendererPlugin>(loader: loader(), key: name); |
28 | } |
29 | |
30 | } // Render |
31 | |
32 | } // Qt3DRender |
33 | |
34 | QT_END_NAMESPACE |
35 |