aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qml/plugins')
-rw-r--r--examples/qml/plugins/README9
-rw-r--r--examples/qml/plugins/doc/images/qml-plugins-example.pngbin0 -> 15773 bytes
-rw-r--r--examples/qml/plugins/doc/src/qmlpluginex.qdoc42
-rw-r--r--examples/qml/plugins/imports/TimeExample/Clock.qml (renamed from examples/qml/plugins/com/nokia/TimeExample/Clock.qml)0
-rw-r--r--examples/qml/plugins/imports/TimeExample/center.png (renamed from examples/qml/plugins/com/nokia/TimeExample/center.png)bin765 -> 765 bytes
-rw-r--r--examples/qml/plugins/imports/TimeExample/clock.png (renamed from examples/qml/plugins/com/nokia/TimeExample/clock.png)bin20653 -> 20653 bytes
-rw-r--r--examples/qml/plugins/imports/TimeExample/hour.png (renamed from examples/qml/plugins/com/nokia/TimeExample/hour.png)bin625 -> 625 bytes
-rw-r--r--examples/qml/plugins/imports/TimeExample/minute.png (renamed from examples/qml/plugins/com/nokia/TimeExample/minute.png)bin625 -> 625 bytes
-rw-r--r--examples/qml/plugins/imports/TimeExample/qmldir (renamed from examples/qml/plugins/com/nokia/TimeExample/qmldir)2
-rw-r--r--examples/qml/plugins/plugin.cpp2
-rw-r--r--examples/qml/plugins/plugins.pro20
-rw-r--r--examples/qml/plugins/plugins.qml4
12 files changed, 56 insertions, 23 deletions
diff --git a/examples/qml/plugins/README b/examples/qml/plugins/README
deleted file mode 100644
index f4f9074059..0000000000
--- a/examples/qml/plugins/README
+++ /dev/null
@@ -1,9 +0,0 @@
-This example shows a module "com.nokia.TimeExample" that is implemented
-by a C++ plugin (providing the "Time" type), and by QML files (providing the
-"Clock" type).
-
-To run:
-
- make install
- QML_IMPORT_PATH=$PWD qmlscene plugins.qml
-
diff --git a/examples/qml/plugins/doc/images/qml-plugins-example.png b/examples/qml/plugins/doc/images/qml-plugins-example.png
new file mode 100644
index 0000000000..c2d4886ea2
--- /dev/null
+++ b/examples/qml/plugins/doc/images/qml-plugins-example.png
Binary files differ
diff --git a/examples/qml/plugins/doc/src/qmlpluginex.qdoc b/examples/qml/plugins/doc/src/qmlpluginex.qdoc
new file mode 100644
index 0000000000..464f42a34c
--- /dev/null
+++ b/examples/qml/plugins/doc/src/qmlpluginex.qdoc
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title QML Plugin Example
+ \example plugins
+
+ \brief This example creates a C++ plugin extension by subclassing QQmlExtensionPlugin.
+
+ \image qml-plugins-example.png
+
+ To run this example, use the following commands on the prompt:
+ \code
+ > qmake
+ > make
+ > qmlscene -I imports plugins.qml
+ \endcode
+*/
diff --git a/examples/qml/plugins/com/nokia/TimeExample/Clock.qml b/examples/qml/plugins/imports/TimeExample/Clock.qml
index ca57caeee5..ca57caeee5 100644
--- a/examples/qml/plugins/com/nokia/TimeExample/Clock.qml
+++ b/examples/qml/plugins/imports/TimeExample/Clock.qml
diff --git a/examples/qml/plugins/com/nokia/TimeExample/center.png b/examples/qml/plugins/imports/TimeExample/center.png
index 7fbd802a44..7fbd802a44 100644
--- a/examples/qml/plugins/com/nokia/TimeExample/center.png
+++ b/examples/qml/plugins/imports/TimeExample/center.png
Binary files differ
diff --git a/examples/qml/plugins/com/nokia/TimeExample/clock.png b/examples/qml/plugins/imports/TimeExample/clock.png
index 462edacc0e..462edacc0e 100644
--- a/examples/qml/plugins/com/nokia/TimeExample/clock.png
+++ b/examples/qml/plugins/imports/TimeExample/clock.png
Binary files differ
diff --git a/examples/qml/plugins/com/nokia/TimeExample/hour.png b/examples/qml/plugins/imports/TimeExample/hour.png
index f8061a1235..f8061a1235 100644
--- a/examples/qml/plugins/com/nokia/TimeExample/hour.png
+++ b/examples/qml/plugins/imports/TimeExample/hour.png
Binary files differ
diff --git a/examples/qml/plugins/com/nokia/TimeExample/minute.png b/examples/qml/plugins/imports/TimeExample/minute.png
index 1297ec7c2b..1297ec7c2b 100644
--- a/examples/qml/plugins/com/nokia/TimeExample/minute.png
+++ b/examples/qml/plugins/imports/TimeExample/minute.png
Binary files differ
diff --git a/examples/qml/plugins/com/nokia/TimeExample/qmldir b/examples/qml/plugins/imports/TimeExample/qmldir
index 9304d95435..252e662e12 100644
--- a/examples/qml/plugins/com/nokia/TimeExample/qmldir
+++ b/examples/qml/plugins/imports/TimeExample/qmldir
@@ -1,3 +1,3 @@
-module com.nokia.TimeExample
+module TimeExample
Clock 1.0 Clock.qml
plugin qmlqtimeexampleplugin
diff --git a/examples/qml/plugins/plugin.cpp b/examples/qml/plugins/plugin.cpp
index 6fce23b62c..d9bbded996 100644
--- a/examples/qml/plugins/plugin.cpp
+++ b/examples/qml/plugins/plugin.cpp
@@ -146,7 +146,7 @@ class QExampleQmlPlugin : public QQmlExtensionPlugin
public:
void registerTypes(const char *uri)
{
- Q_ASSERT(uri == QLatin1String("com.nokia.TimeExample"));
+ Q_ASSERT(uri == QLatin1String("TimeExample"));
qmlRegisterType<TimeModel>(uri, 1, 0, "Time");
}
};
diff --git a/examples/qml/plugins/plugins.pro b/examples/qml/plugins/plugins.pro
index e127509c0d..2c748f7952 100644
--- a/examples/qml/plugins/plugins.pro
+++ b/examples/qml/plugins/plugins.pro
@@ -2,24 +2,24 @@ TEMPLATE = lib
CONFIG += qt plugin
QT += qml
-DESTDIR = com/nokia/TimeExample
+DESTDIR = imports/TimeExample
TARGET = qmlqtimeexampleplugin
SOURCES += plugin.cpp
qdeclarativesources.files += \
- com/nokia/TimeExample/qmldir \
- com/nokia/TimeExample/center.png \
- com/nokia/TimeExample/clock.png \
- com/nokia/TimeExample/Clock.qml \
- com/nokia/TimeExample/hour.png \
- com/nokia/TimeExample/minute.png
+ imports/TimeExample/qmldir \
+ imports/TimeExample/center.png \
+ imports/TimeExample/clock.png \
+ imports/TimeExample/Clock.qml \
+ imports/TimeExample/hour.png \
+ imports/TimeExample/minute.png
-qdeclarativesources.path += $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/plugins/com/nokia/TimeExample
+qdeclarativesources.path += $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/plugins/imports/TimeExample
-sources.files += plugins.pro plugin.cpp plugins.qml README
+sources.files += plugins.pro plugin.cpp plugins.qml
sources.path += $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/plugins
-target.path += $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/plugins/com/nokia/TimeExample
+target.path += $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/plugins/imports/TimeExample
INSTALLS += qdeclarativesources sources target
diff --git a/examples/qml/plugins/plugins.qml b/examples/qml/plugins/plugins.qml
index a184395c64..db570cf307 100644
--- a/examples/qml/plugins/plugins.qml
+++ b/examples/qml/plugins/plugins.qml
@@ -38,9 +38,9 @@
**
****************************************************************************/
//![0]
-import com.nokia.TimeExample 1.0 // import types from the plugin
+import TimeExample 1.0 // import types from the plugin
-Clock { // this class is defined in QML (com/nokia/TimeExample/Clock.qml)
+Clock { // this class is defined in QML (imports/TimeExample/Clock.qml)
Time { // this class is defined in C++ (plugin.cpp)
id: time