diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2017-03-24 09:36:22 +0100 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2017-04-28 14:15:23 +0000 |
commit | 4a4a8e911cfafcff069de0c1acb2462974166938 (patch) | |
tree | e832682afe281d507ea73e8fc0272c0738c8efd5 /src/imports/sharedimage/plugin.cpp | |
parent | 3b798efeb0029bb5314c7bd960f43357b39a394a (diff) |
Polish the shared image provider
When the new shared memory image provider was added, some of the
issues identified during review were postponed to be fixed during
stabilization phase. This commit deals with
- Replace the kludge for registering plugin version
- Add autotest
- Place plugin in labs
- Use QT_CONFIG instead of QT_NO_xxx
- Use the new extended image provider api, in order to use the
scaled-size calculation from Quick
Change-Id: I75c01c7565650fcf859411dde9520ee65b2b0c64
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/imports/sharedimage/plugin.cpp')
-rw-r--r-- | src/imports/sharedimage/plugin.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/imports/sharedimage/plugin.cpp b/src/imports/sharedimage/plugin.cpp index f20edc641c..53e95ef21a 100644 --- a/src/imports/sharedimage/plugin.cpp +++ b/src/imports/sharedimage/plugin.cpp @@ -43,7 +43,7 @@ /*! - \qmlmodule QtQuick.SharedImage 1 + \qmlmodule Qt.labs.sharedimage 1 \title Qt Quick Shared Image Provider \ingroup qmlmodules \brief Adds an image provider which utilizes shared CPU memory @@ -62,7 +62,7 @@ To use this module, import it like this: \code - import QtQuick.SharedImage 1.0 + import Qt.labs.sharedimage 1.0 \endcode The sharing functionality is provided through a QQuickImageProvider. Use @@ -99,13 +99,6 @@ The shared image module does not provide any directly usable QML types. */ -static void initResources() -{ -#ifdef QT_STATIC - Q_INIT_RESOURCE(qmake_QtQuick_SharedImage); -#endif -} - QT_BEGIN_NAMESPACE class QtQuickSharedImagePlugin : public QQmlExtensionPlugin @@ -113,13 +106,12 @@ class QtQuickSharedImagePlugin : public QQmlExtensionPlugin Q_OBJECT Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: - QtQuickSharedImagePlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } + QtQuickSharedImagePlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) {} - void registerTypes(const char *uri) Q_DECL_OVERRIDE + void registerTypes(const char *uri) override { - Q_ASSERT(uri == QStringLiteral("QtQuick.SharedImage")); - // Need to register *something* to let our version number be known: - qmlRegisterTypeNotAvailable(uri, 1, 0, "nosuchtype", QStringLiteral("Just a dummy type, do not use")); + Q_ASSERT(uri == QStringLiteral("Qt.labs.sharedimage")); + qmlRegisterModule(uri, 1, 0); } void initializeEngine(QQmlEngine *engine, const char *uri) override |