summaryrefslogtreecommitdiffstats
path: root/examples/declarative
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-07-21 05:27:32 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-07-21 05:28:55 (GMT)
commit2c6312bcb2a80431e6f0cf16d6c4c1d016d40b03 (patch)
tree0f78589e231f14a7bcc2cab10d2f8b2d9a203ce6 /examples/declarative
parentbbc400805f965129341fc3c6a98c4f8b0f9523a4 (diff)
downloadQt-2c6312bcb2a80431e6f0cf16d6c4c1d016d40b03.zip
Qt-2c6312bcb2a80431e6f0cf16d6c4c1d016d40b03.tar.gz
Qt-2c6312bcb2a80431e6f0cf16d6c4c1d016d40b03.tar.bz2
Expand QDeclarativeExtensionPlugin docs
Diffstat (limited to 'examples/declarative')
-rw-r--r--examples/declarative/cppextensions/plugins/plugin.cpp6
-rw-r--r--examples/declarative/cppextensions/plugins/plugins.qml3
2 files changed, 8 insertions, 1 deletions
diff --git a/examples/declarative/cppextensions/plugins/plugin.cpp b/examples/declarative/cppextensions/plugins/plugin.cpp
index 355ca3f..01d5361 100644
--- a/examples/declarative/cppextensions/plugins/plugin.cpp
+++ b/examples/declarative/cppextensions/plugins/plugin.cpp
@@ -96,11 +96,13 @@ private:
QBasicTimer timer;
};
+//![0]
class TimeModel : public QObject
{
Q_OBJECT
Q_PROPERTY(int hour READ hour NOTIFY timeChanged)
Q_PROPERTY(int minute READ minute NOTIFY timeChanged)
+//![0]
public:
TimeModel(QObject *parent=0) : QObject(parent)
@@ -135,6 +137,7 @@ private:
int TimeModel::instances=0;
MinuteTimer *TimeModel::timer=0;
+//![plugin]
class QExampleQmlPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
@@ -145,7 +148,10 @@ public:
qmlRegisterType<TimeModel>(uri, 1, 0, "Time");
}
};
+//![plugin]
#include "plugin.moc"
+//![export]
Q_EXPORT_PLUGIN2(qmlqtimeexampleplugin, QExampleQmlPlugin);
+//![export]
diff --git a/examples/declarative/cppextensions/plugins/plugins.qml b/examples/declarative/cppextensions/plugins/plugins.qml
index 1832017..8d1085c 100644
--- a/examples/declarative/cppextensions/plugins/plugins.qml
+++ b/examples/declarative/cppextensions/plugins/plugins.qml
@@ -37,7 +37,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
+//![0]
import com.nokia.TimeExample 1.0 // import types from the plugin
Clock { // this class is defined in QML (com/nokia/TimeExample/Clock.qml)
@@ -49,3 +49,4 @@ Clock { // this class is defined in QML (com/nokia/TimeExample/Clock.qml)
hours: time.hour
minutes: time.minute
}
+//![0]