diff options
Diffstat (limited to 'examples/quick/customitems/painteditem')
3 files changed, 14 insertions, 14 deletions
diff --git a/examples/quick/customitems/painteditem/TextBalloonPlugin/plugin.h b/examples/quick/customitems/painteditem/TextBalloonPlugin/plugin.h index d3a1f4ba91..4abf2cf3dc 100644 --- a/examples/quick/customitems/painteditem/TextBalloonPlugin/plugin.h +++ b/examples/quick/customitems/painteditem/TextBalloonPlugin/plugin.h @@ -48,17 +48,12 @@ ** ****************************************************************************/ -#include <QQmlExtensionPlugin> +#include <QQmlEngineExtensionPlugin> #include "../textballoon.h" -class TextBalloonPlugin : public QQmlExtensionPlugin +class TextBalloonPlugin : public QQmlEngineExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) -public: - void registerTypes(const char *uri) - { - qmlRegisterType<TextBalloon>(uri, 1, 0, "TextBalloon"); - } + Q_PLUGIN_METADATA(IID QQmlEngineExtensionInterface_iid) }; diff --git a/examples/quick/customitems/painteditem/painteditem.pro b/examples/quick/customitems/painteditem/painteditem.pro index bc7480ab9e..641833f3aa 100644 --- a/examples/quick/customitems/painteditem/painteditem.pro +++ b/examples/quick/customitems/painteditem/painteditem.pro @@ -1,21 +1,25 @@ TEMPLATE = lib -CONFIG += plugin +CONFIG += plugin qmltypes QT += qml quick +QML_IMPORT_NAME = TextBalloonPlugin +QML_IMPORT_MAJOR_VERSION = 1 + TARGET = qmltextballoonplugin -HEADERS += TextBalloonPlugin/plugin.h \ +HEADERS += \ + TextBalloonPlugin/plugin.h \ textballoon.h SOURCES += textballoon.cpp RESOURCES += painteditem.qrc -DESTDIR = TextBalloonPlugin +DESTDIR = $$QML_IMPORT_NAME -target.path = $$[QT_INSTALL_EXAMPLES]/quick/customitems/painteditem/TextBalloonPlugin -qmldir.files = TextBalloonPlugin/qmldir -qmldir.path = $$[QT_INSTALL_EXAMPLES]/quick/customitems/painteditem/TextBalloonPlugin +target.path = $$[QT_INSTALL_EXAMPLES]/quick/customitems/painteditem/$$QML_IMPORT_NAME +qmldir.files = $$QML_IMPORT_NAME/qmldir +qmldir.path = $$[QT_INSTALL_EXAMPLES]/quick/customitems/painteditem/$$QML_IMPORT_NAME INSTALLS += qmldir target diff --git a/examples/quick/customitems/painteditem/textballoon.h b/examples/quick/customitems/painteditem/textballoon.h index 81b3e2961d..eb72804602 100644 --- a/examples/quick/customitems/painteditem/textballoon.h +++ b/examples/quick/customitems/painteditem/textballoon.h @@ -58,6 +58,7 @@ class TextBalloon : public QQuickPaintedItem { Q_OBJECT Q_PROPERTY(bool rightAligned READ isRightAligned WRITE setRightAligned NOTIFY rightAlignedChanged) + QML_ELEMENT public: TextBalloon(QQuickItem *parent = 0); |