Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
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
// Qt-Security score:significant reason:default
4
5
#
include
"qgenericpluginfactory.h"
6
7
#
include
"qguiapplication.h"
8
#
include
"private/qfactoryloader_p.h"
9
#
include
"qgenericplugin.h"
10
#
include
"qdebug.h"
11
12
QT_BEGIN_NAMESPACE
13
14
using
namespace
Qt::StringLiterals;
15
16
Q_GLOBAL_STATIC_WITH_ARGS
(QFactoryLoader, gpLoader,
17
(
QGenericPluginFactoryInterface_iid
,
"/generic"_L1
, Qt::CaseInsensitive))
18
19
/*!
20
\class QGenericPluginFactory
21
\ingroup plugins
22
\inmodule QtGui
23
24
\brief The QGenericPluginFactory class creates plugin drivers.
25
26
\sa QGenericPlugin
27
*/
28
29
/*!
30
Creates the driver specified by \a key, using the given \a specification.
31
32
Note that the keys are case-insensitive.
33
34
\sa keys()
35
*/
36
QObject *QGenericPluginFactory::create(
const
QString& key,
const
QString &specification)
37
{
38
return
qLoadPlugin<QObject, QGenericPlugin>(gpLoader(), key.toLower(), specification);
39
}
40
41
/*!
42
Returns the list of valid keys, i.e. the available mouse drivers.
43
44
\sa create()
45
*/
46
QStringList QGenericPluginFactory::keys()
47
{
48
QStringList list;
49
50
typedef
QMultiMap<
int
, QString> PluginKeyMap;
51
typedef
PluginKeyMap::const_iterator PluginKeyMapConstIterator;
52
53
const
PluginKeyMap keyMap = gpLoader()->keyMap();
54
const
PluginKeyMapConstIterator cend = keyMap.constEnd();
55
for
(PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend; ++it)
56
if
(!list.contains(it.value()))
57
list += it.value();
58
return
list;
59
}
60
61
QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QGenericPluginFactoryInterface_iid
#define QGenericPluginFactoryInterface_iid
Definition
qgenericplugin.h:14
Q_GLOBAL_STATIC_WITH_ARGS
Q_GLOBAL_STATIC_WITH_ARGS(PermissionStatusHash, g_permissionStatusHash,({ { qMetaTypeId< QCameraPermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QMicrophonePermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QBluetoothPermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QContactsPermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QCalendarPermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QLocationPermission >(), Qt::PermissionStatus::Undetermined } }))
qtbase
src
gui
kernel
qgenericpluginfactory.cpp
Generated on
for Qt by
1.18.0