summaryrefslogtreecommitdiffstats
path: root/QtLauncher/QtImageProviders/plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'QtLauncher/QtImageProviders/plugin.cpp')
-rw-r--r--QtLauncher/QtImageProviders/plugin.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/QtLauncher/QtImageProviders/plugin.cpp b/QtLauncher/QtImageProviders/plugin.cpp
new file mode 100644
index 0000000..e17732d
--- /dev/null
+++ b/QtLauncher/QtImageProviders/plugin.cpp
@@ -0,0 +1,25 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include <imageproviders.h>
+#include <QtQml/qqmlextensionplugin.h>
+
+void qml_register_types_QtLauncher_QtImageProviders();
+
+class QtImageProvidersPlugin : public QQmlEngineExtensionPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QQmlEngineExtensionInterface_iid)
+public:
+ void initializeEngine(QQmlEngine *engine, const char *uri) final
+ {
+ volatile auto registration = &qml_register_types_QtLauncher_QtImageProviders;
+ Q_UNUSED(registration);
+ Q_UNUSED(uri);
+
+ engine->addImageProvider("QtSquareImage", new QtSquareImageProvider);
+ engine->addImageProvider("QtImageMask", new QtImageMaskProvider);
+ engine->addImageProvider("QtButtonImage", new QtButtonImageProvider);
+ }
+};
+#include "plugin.moc"