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
qpluginloader.h
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#ifndef QPLUGINLOADER_H
5#define QPLUGINLOADER_H
6
7#include <QtCore/qglobal.h>
8#if QT_CONFIG(library)
9#include <QtCore/qlibrary.h>
10#endif
11#include <QtCore/qplugin.h>
12
14
15#if QT_CONFIG(library)
16
17class QLibraryPrivate;
18class QJsonObject;
19
20class Q_CORE_EXPORT QPluginLoader : public QObject
21{
24 Q_PROPERTY(QLibrary::LoadHints loadHints READ loadHints WRITE setLoadHints)
25public:
26 explicit QPluginLoader(QObject *parent = nullptr);
27 explicit QPluginLoader(const QString &fileName, QObject *parent = nullptr);
29
30 QObject *instance();
31 QJsonObject metaData() const;
32
33 static QObjectList staticInstances();
34 static QList<QStaticPlugin> staticPlugins();
35
36 bool load();
37 bool unload();
38 bool isLoaded() const;
39
40 void setFileName(const QString &fileName);
41 QString fileName() const;
42
43 QString errorString() const;
44
45 void setLoadHints(QLibrary::LoadHints loadHints);
46 QLibrary::LoadHints loadHints() const;
47
48private:
50 bool did_load;
51 Q_DISABLE_COPY(QPluginLoader)
52};
53
54#else
55
56class Q_CORE_EXPORT QPluginLoader
57{
58public:
59 static QObjectList staticInstances();
60 static QList<QStaticPlugin> staticPlugins();
61};
62
63#endif // QT_CONFIG(library)
64
66
67#endif // QPLUGINLOADER_H
\inmodule QtCore\reentrant
Definition qjsonobject.h:20
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
p1 load("image.bmp")
Combined button and popup list for selecting options.
Q_MULTIMEDIA_EXPORT QString errorString(HRESULT hr)
#define Q_PROPERTY(...)
#define Q_OBJECT
file setFileName("readme.txt")