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
qgenericpluginfactory.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
5
6#include "qguiapplication.h"
7#include "private/qfactoryloader_p.h"
8#include "qgenericplugin.h"
9#include "qdebug.h"
10
12
13using namespace Qt::StringLiterals;
14
17
18
35QObject *QGenericPluginFactory::create(const QString& key, const QString &specification)
36{
37 return qLoadPlugin<QObject, QGenericPlugin>(gpLoader(), key.toLower(), specification);
38}
39
46{
48
49 typedef QMultiMap<int, QString> PluginKeyMap;
50 typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
51
52 const PluginKeyMap keyMap = gpLoader()->keyMap();
53 const PluginKeyMapConstIterator cend = keyMap.constEnd();
54 for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend; ++it)
55 if (!list.contains(it.value()))
56 list += it.value();
57 return list;
58}
59
static QObject * create(const QString &, const QString &)
static QStringList keys()
Returns the list of valid keys, i.e.
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QSet< QString >::iterator it
Combined button and popup list for selecting options.
@ CaseInsensitive
#define QGenericPluginFactoryInterface_iid
#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS)
GLuint64 key
static const struct @450 keyMap[]
QList< int > list
[14]
bool contains(const AT &t) const noexcept
Definition qlist.h:45