aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlmetatype_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-06-02 16:50:20 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-06-09 08:01:02 +0200
commit5dc14c88f9510795835fb4f0a0d46d67c40f7020 (patch)
tree937173d548a6ad0d4c46cf75914adb6f6b140254 /src/qml/qml/qqmlmetatype_p.h
parent6a48a81319b886c8a3f85e1eb024186b05d0f3af (diff)
Allow QML plugins to be optional
If a plugin does nothing but load the library that provides the types, we can skip the plugin loading by linking the library directly. State that in the qmldir file, and evaluate it when loading the module. Task-number: QTBUG-84639 Change-Id: I2097237866a50f66c55e4653ad119fe10e18a893 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlmetatype_p.h')
-rw-r--r--src/qml/qml/qqmlmetatype_p.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h
index 08d79d2e5b..9ce33ab545 100644
--- a/src/qml/qml/qqmlmetatype_p.h
+++ b/src/qml/qml/qqmlmetatype_p.h
@@ -73,14 +73,20 @@ struct CompositeMetaTypeIds
class Q_QML_PRIVATE_EXPORT QQmlMetaType
{
public:
+ enum class RegistrationResult {
+ Success,
+ Failure,
+ NoRegistrationFunction
+ };
+
static QQmlType registerType(const QQmlPrivate::RegisterType &type);
static QQmlType registerInterface(const QQmlPrivate::RegisterInterface &type);
static QQmlType registerSingletonType(const QQmlPrivate::RegisterSingletonType &type);
static QQmlType registerCompositeSingletonType(const QQmlPrivate::RegisterCompositeSingletonType &type);
static QQmlType registerCompositeType(const QQmlPrivate::RegisterCompositeType &type);
- static bool registerPluginTypes(QObject *instance, const QString &basePath,
- const QString &uri, const QString &typeNamespace,
- QTypeRevision version, QList<QQmlError> *errors);
+ static RegistrationResult registerPluginTypes(QObject *instance, const QString &basePath,
+ const QString &uri, const QString &typeNamespace,
+ QTypeRevision version, QList<QQmlError> *errors);
static QQmlType typeForUrl(const QString &urlString, const QHashedStringRef& typeName,
bool isCompositeSingleton, QList<QQmlError> *errors,
QTypeRevision version = QTypeRevision());