diff options
author | Svetlana Abramenkova <sabramenkova@luxoft.com> | 2019-02-12 19:49:31 +0300 |
---|---|---|
committer | Svetlana Abramenkova <sabramenkova@luxoft.com> | 2019-02-18 04:41:11 +0000 |
commit | 11a9875e544b36ced2f82bfad05aa50c8021ccc9 (patch) | |
tree | 9eb678d97f726860125a2fa7d05a1a10bd62ab36 | |
parent | 04613840ca0191f7e5d5bd7dfe69b13abcd69680 (diff) |
Fix QML Live examples & docs install
ContentPlugin source code should be installed into QT_INSTALL_EXAMPLES,
updated deprecated dependencies in the ContentPlugin, fixed app example
install path
Change-Id: Ifa2101ff8e483e88a9def09275e9ca18ec07c4de
Fixes: AUTOSUITE-751
Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
-rw-r--r-- | examples/app/app.pro | 10 | ||||
-rw-r--r-- | examples/contentplugin/contentplugin.pro | 12 | ||||
-rw-r--r-- | examples/contentplugin/mycontentadapterplugin.cpp | 7 | ||||
-rw-r--r-- | examples/contentplugin/mycontentadapterplugin.h | 3 | ||||
-rw-r--r-- | examples/examples.pro | 4 |
5 files changed, 20 insertions, 16 deletions
diff --git a/examples/app/app.pro b/examples/app/app.pro index cc41e36..bb53fb3 100644 --- a/examples/app/app.pro +++ b/examples/app/app.pro @@ -12,16 +12,12 @@ SOURCES += main.cpp target.path = $$EXAMPLES_PREFIX/app INSTALLS += target -qml.files = \ - qml/customruntime-item.qml \ - qml/customruntime-window.qml \ - qml/item.qml \ - qml/window.qml -qml.path = $$EXAMPLES_PREFIX/app/qml +qml.files = qml/*.qml +qml.path = $$target.path/qml INSTALLS += qml OTHER_FILES += $$qml.files icon.files = icon.png -icon.path = $$EXAMPLES_PREFIX/app +icon.path = $$target.path INSTALLS += icon OTHER_FILES += $$icon.files diff --git a/examples/contentplugin/contentplugin.pro b/examples/contentplugin/contentplugin.pro index c142b07..da2d0a2 100644 --- a/examples/contentplugin/contentplugin.pro +++ b/examples/contentplugin/contentplugin.pro @@ -1,13 +1,19 @@ TEMPLATE = lib -CONFIG += plugin +CONFIG += plugin c++11 +QT += qml + +include(../../src/lib.pri) + INCLUDEPATH += ../../src HEADERS = mycontentadapterplugin.h SOURCES = mycontentadapterplugin.cpp TARGET = myContentAdapterPlugin DESTDIR = ../../bin/plugins -RESOURCES += res.qrc \ - res.qrc +RESOURCES += res.qrc OTHER_FILES += \ plugin.qml + +target.path = $$EXAMPLES_PREFIX/contentplugin +INSTALLS += target diff --git a/examples/contentplugin/mycontentadapterplugin.cpp b/examples/contentplugin/mycontentadapterplugin.cpp index ac3b196..1e5b0b6 100644 --- a/examples/contentplugin/mycontentadapterplugin.cpp +++ b/examples/contentplugin/mycontentadapterplugin.cpp @@ -32,7 +32,7 @@ #include "mycontentadapterplugin.h" #include <QtCore/QtPlugin> -#include <QtDeclarative/QDeclarativeContext> +#include <QQmlContext> MyContentAdapterPlugin::MyContentAdapterPlugin(QObject *parent) : QObject(parent) @@ -64,12 +64,11 @@ bool MyContentAdapterPlugin::canAdapt(const QUrl &url) const //! [0] //! [1] -QUrl MyContentAdapterPlugin::adapt(const QUrl &url, QDeclarativeContext *context) + +QUrl MyContentAdapterPlugin::adapt(const QUrl &url, QQmlContext *context) { context->setContextProperty("imageSource", url); return QString("qrc:/mycontentadatperplugin/plugin.qml"); } //! [1] - -Q_EXPORT_PLUGIN2(myContentAdapterPlugin, MyContentAdapterPlugin) diff --git a/examples/contentplugin/mycontentadapterplugin.h b/examples/contentplugin/mycontentadapterplugin.h index 43343e7..a70bc5c 100644 --- a/examples/contentplugin/mycontentadapterplugin.h +++ b/examples/contentplugin/mycontentadapterplugin.h @@ -41,6 +41,7 @@ class MyContentAdapterPlugin : public QObject, public ContentAdapterInterface //! [1] Q_INTERFACES(ContentAdapterInterface) //! [1] + Q_PLUGIN_METADATA(IID "io.qt.QMLLive.ContentPlugin") public: explicit MyContentAdapterPlugin(QObject *parent = 0); @@ -48,8 +49,8 @@ public: QImage preview(const QString& path, const QSize &requestedSize); bool canAdapt(const QUrl& url) const; - QUrl adapt(const QUrl& url, QDeclarativeContext* context); + QUrl adapt(const QUrl& url, QQmlContext* context); }; //! [0] diff --git a/examples/examples.pro b/examples/examples.pro index b288ed9..727afa9 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -1,2 +1,4 @@ TEMPLATE = subdirs -SUBDIRS += app +SUBDIRS += app \ + contentplugin + |