aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/tutorials/extending-qml/chapter6-plugins
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qml/tutorials/extending-qml/chapter6-plugins')
-rw-r--r--examples/qml/tutorials/extending-qml/chapter6-plugins/import/chartsplugin.cpp3
-rw-r--r--examples/qml/tutorials/extending-qml/chapter6-plugins/import/piechart.h1
-rw-r--r--examples/qml/tutorials/extending-qml/chapter6-plugins/import/pieslice.h1
3 files changed, 3 insertions, 2 deletions
diff --git a/examples/qml/tutorials/extending-qml/chapter6-plugins/import/chartsplugin.cpp b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/chartsplugin.cpp
index ce8b95b6b6..74d382ec57 100644
--- a/examples/qml/tutorials/extending-qml/chapter6-plugins/import/chartsplugin.cpp
+++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/chartsplugin.cpp
@@ -55,8 +55,7 @@
void ChartsPlugin::registerTypes(const char *uri)
{
- qmlRegisterType<PieChart>(uri, 1, 0, "PieChart");
- qmlRegisterType<PieSlice>(uri, 1, 0, "PieSlice");
+ qmlRegisterTypesAndRevisions<PieChart, PieSlice>(uri, 1);
}
//![0]
diff --git a/examples/qml/tutorials/extending-qml/chapter6-plugins/import/piechart.h b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/piechart.h
index cd67bdf34a..e6b768b274 100644
--- a/examples/qml/tutorials/extending-qml/chapter6-plugins/import/piechart.h
+++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/piechart.h
@@ -59,6 +59,7 @@ class PieChart : public QQuickItem
Q_OBJECT
Q_PROPERTY(QQmlListProperty<PieSlice> slices READ slices)
Q_PROPERTY(QString name READ name WRITE setName)
+ QML_ELEMENT
public:
PieChart(QQuickItem *parent = 0);
diff --git a/examples/qml/tutorials/extending-qml/chapter6-plugins/import/pieslice.h b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/pieslice.h
index 71cc20a369..091870bd51 100644
--- a/examples/qml/tutorials/extending-qml/chapter6-plugins/import/pieslice.h
+++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/pieslice.h
@@ -59,6 +59,7 @@ class PieSlice : public QQuickPaintedItem
Q_PROPERTY(QColor color READ color WRITE setColor)
Q_PROPERTY(int fromAngle READ fromAngle WRITE setFromAngle)
Q_PROPERTY(int angleSpan READ angleSpan WRITE setAngleSpan)
+ QML_ELEMENT
public:
PieSlice(QQuickItem *parent = 0);