diff options
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter1-basics/app.qml (renamed from examples/qml/tutorials/extending/chapter1-basics/app.qml) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter1-basics/chapter1-basics.pro (renamed from examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.pro) | 2 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter1-basics/chapter1-basics.qrc (renamed from examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.qrc) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter1-basics/main.cpp (renamed from examples/qml/tutorials/extending/chapter1-basics/main.cpp) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter1-basics/piechart.cpp (renamed from examples/qml/tutorials/extending/chapter1-basics/piechart.cpp) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter1-basics/piechart.h (renamed from examples/qml/tutorials/extending/chapter1-basics/piechart.h) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter2-methods/app.qml (renamed from examples/qml/tutorials/extending/chapter2-methods/app.qml) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter2-methods/chapter2-methods.pro (renamed from examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.pro) | 2 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter2-methods/chapter2-methods.qrc (renamed from examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.qrc) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter2-methods/main.cpp (renamed from examples/qml/tutorials/extending/chapter2-methods/main.cpp) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter2-methods/piechart.cpp (renamed from examples/qml/tutorials/extending/chapter2-methods/piechart.cpp) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter2-methods/piechart.h (renamed from examples/qml/tutorials/extending/chapter2-methods/piechart.h) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter3-bindings/app.qml (renamed from examples/qml/tutorials/extending/chapter3-bindings/app.qml) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter3-bindings/chapter3-binding.qrc (renamed from examples/qml/tutorials/extending/chapter3-bindings/chapter3-binding.qrc) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter3-bindings/chapter3-bindings.pro (renamed from examples/qml/tutorials/extending/chapter3-bindings/chapter3-bindings.pro) | 2 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter3-bindings/main.cpp (renamed from examples/qml/tutorials/extending/chapter3-bindings/main.cpp) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter3-bindings/piechart.cpp (renamed from examples/qml/tutorials/extending/chapter3-bindings/piechart.cpp) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter3-bindings/piechart.h (renamed from examples/qml/tutorials/extending/chapter3-bindings/piechart.h) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/app.qml (renamed from examples/qml/tutorials/extending/chapter4-customPropertyTypes/app.qml) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro (renamed from examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro) | 2 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/chapter4-customPropertyTypes.qrc (renamed from examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.qrc) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/main.cpp (renamed from examples/qml/tutorials/extending/chapter4-customPropertyTypes/main.cpp) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/piechart.cpp (renamed from examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/piechart.h (renamed from examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.h) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/pieslice.cpp (renamed from examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/pieslice.h (renamed from examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.h) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter5-listproperties/app.qml (renamed from examples/qml/tutorials/extending/chapter5-listproperties/app.qml) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter5-listproperties/chapter5-listproperties.pro (renamed from examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro) | 2 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter5-listproperties/chapter5-listproperties.qrc (renamed from examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.qrc) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter5-listproperties/main.cpp (renamed from examples/qml/tutorials/extending/chapter5-listproperties/main.cpp) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter5-listproperties/piechart.cpp (renamed from examples/qml/tutorials/extending/chapter5-listproperties/piechart.cpp) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter5-listproperties/piechart.h (renamed from examples/qml/tutorials/extending/chapter5-listproperties/piechart.h) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter5-listproperties/pieslice.cpp (renamed from examples/qml/tutorials/extending/chapter5-listproperties/pieslice.cpp) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter5-listproperties/pieslice.h (renamed from examples/qml/tutorials/extending/chapter5-listproperties/pieslice.h) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter6-plugins/app.pro (renamed from examples/qml/tutorials/extending/chapter6-plugins/app.pro) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter6-plugins/app.qml (renamed from examples/qml/tutorials/extending/chapter6-plugins/app.qml) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter6-plugins/app.qrc (renamed from examples/qml/tutorials/extending/chapter6-plugins/app.qrc) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter6-plugins/chapter6-plugins.pro (renamed from examples/qml/tutorials/extending/chapter6-plugins/chapter6-plugins.pro) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter6-plugins/import/chartsplugin.cpp (renamed from examples/qml/tutorials/extending/chapter6-plugins/import/chartsplugin.cpp) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter6-plugins/import/chartsplugin.h (renamed from examples/qml/tutorials/extending/chapter6-plugins/import/chartsplugin.h) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter6-plugins/import/import.pro (renamed from examples/qml/tutorials/extending/chapter6-plugins/import/import.pro) | 2 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter6-plugins/import/piechart.cpp (renamed from examples/qml/tutorials/extending/chapter6-plugins/import/piechart.cpp) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter6-plugins/import/piechart.h (renamed from examples/qml/tutorials/extending/chapter6-plugins/import/piechart.h) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter6-plugins/import/pieslice.cpp (renamed from examples/qml/tutorials/extending/chapter6-plugins/import/pieslice.cpp) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter6-plugins/import/pieslice.h (renamed from examples/qml/tutorials/extending/chapter6-plugins/import/pieslice.h) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter6-plugins/import/qmldir (renamed from examples/qml/tutorials/extending/chapter6-plugins/import/qmldir) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/chapter6-plugins/main.cpp (renamed from examples/qml/tutorials/extending/chapter6-plugins/main.cpp) | 0 | ||||
-rw-r--r-- | examples/qml/tutorials/extending-qml/extending-qml.pro (renamed from examples/qml/tutorials/extending/extending.pro) | 0 | ||||
-rw-r--r-- | src/qml/doc/src/cppintegration/extending-tutorial.qdoc | 188 |
49 files changed, 81 insertions, 119 deletions
diff --git a/examples/qml/tutorials/extending/chapter1-basics/app.qml b/examples/qml/tutorials/extending-qml/chapter1-basics/app.qml index d2f03daf83..d2f03daf83 100644 --- a/examples/qml/tutorials/extending/chapter1-basics/app.qml +++ b/examples/qml/tutorials/extending-qml/chapter1-basics/app.qml diff --git a/examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.pro b/examples/qml/tutorials/extending-qml/chapter1-basics/chapter1-basics.pro index c28664ea51..9911e02484 100644 --- a/examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.pro +++ b/examples/qml/tutorials/extending-qml/chapter1-basics/chapter1-basics.pro @@ -6,7 +6,7 @@ SOURCES += piechart.cpp \ RESOURCES += chapter1-basics.qrc -DESTPATH = $$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending/chapter1-basics +DESTPATH = $$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending-qml/chapter1-basics target.path = $$DESTPATH qml.files = *.qml diff --git a/examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.qrc b/examples/qml/tutorials/extending-qml/chapter1-basics/chapter1-basics.qrc index f1168aef3b..f1168aef3b 100644 --- a/examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.qrc +++ b/examples/qml/tutorials/extending-qml/chapter1-basics/chapter1-basics.qrc diff --git a/examples/qml/tutorials/extending/chapter1-basics/main.cpp b/examples/qml/tutorials/extending-qml/chapter1-basics/main.cpp index 4e719d2722..4e719d2722 100644 --- a/examples/qml/tutorials/extending/chapter1-basics/main.cpp +++ b/examples/qml/tutorials/extending-qml/chapter1-basics/main.cpp diff --git a/examples/qml/tutorials/extending/chapter1-basics/piechart.cpp b/examples/qml/tutorials/extending-qml/chapter1-basics/piechart.cpp index fa005781d8..fa005781d8 100644 --- a/examples/qml/tutorials/extending/chapter1-basics/piechart.cpp +++ b/examples/qml/tutorials/extending-qml/chapter1-basics/piechart.cpp diff --git a/examples/qml/tutorials/extending/chapter1-basics/piechart.h b/examples/qml/tutorials/extending-qml/chapter1-basics/piechart.h index a6272453ce..a6272453ce 100644 --- a/examples/qml/tutorials/extending/chapter1-basics/piechart.h +++ b/examples/qml/tutorials/extending-qml/chapter1-basics/piechart.h diff --git a/examples/qml/tutorials/extending/chapter2-methods/app.qml b/examples/qml/tutorials/extending-qml/chapter2-methods/app.qml index 06ecb3a09d..06ecb3a09d 100644 --- a/examples/qml/tutorials/extending/chapter2-methods/app.qml +++ b/examples/qml/tutorials/extending-qml/chapter2-methods/app.qml diff --git a/examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.pro b/examples/qml/tutorials/extending-qml/chapter2-methods/chapter2-methods.pro index a451c775cf..7fd850ce36 100644 --- a/examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.pro +++ b/examples/qml/tutorials/extending-qml/chapter2-methods/chapter2-methods.pro @@ -6,7 +6,7 @@ SOURCES += piechart.cpp \ RESOURCES += chapter2-methods.qrc -DESTPATH = $$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending/chapter2-methods +DESTPATH = $$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending-qml/chapter2-methods target.path = $$DESTPATH qml.files = *.qml diff --git a/examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.qrc b/examples/qml/tutorials/extending-qml/chapter2-methods/chapter2-methods.qrc index f1168aef3b..f1168aef3b 100644 --- a/examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.qrc +++ b/examples/qml/tutorials/extending-qml/chapter2-methods/chapter2-methods.qrc diff --git a/examples/qml/tutorials/extending/chapter2-methods/main.cpp b/examples/qml/tutorials/extending-qml/chapter2-methods/main.cpp index 4e719d2722..4e719d2722 100644 --- a/examples/qml/tutorials/extending/chapter2-methods/main.cpp +++ b/examples/qml/tutorials/extending-qml/chapter2-methods/main.cpp diff --git a/examples/qml/tutorials/extending/chapter2-methods/piechart.cpp b/examples/qml/tutorials/extending-qml/chapter2-methods/piechart.cpp index ddcb1b3efd..ddcb1b3efd 100644 --- a/examples/qml/tutorials/extending/chapter2-methods/piechart.cpp +++ b/examples/qml/tutorials/extending-qml/chapter2-methods/piechart.cpp diff --git a/examples/qml/tutorials/extending/chapter2-methods/piechart.h b/examples/qml/tutorials/extending-qml/chapter2-methods/piechart.h index 86750197d2..86750197d2 100644 --- a/examples/qml/tutorials/extending/chapter2-methods/piechart.h +++ b/examples/qml/tutorials/extending-qml/chapter2-methods/piechart.h diff --git a/examples/qml/tutorials/extending/chapter3-bindings/app.qml b/examples/qml/tutorials/extending-qml/chapter3-bindings/app.qml index afb9e25c51..afb9e25c51 100644 --- a/examples/qml/tutorials/extending/chapter3-bindings/app.qml +++ b/examples/qml/tutorials/extending-qml/chapter3-bindings/app.qml diff --git a/examples/qml/tutorials/extending/chapter3-bindings/chapter3-binding.qrc b/examples/qml/tutorials/extending-qml/chapter3-bindings/chapter3-binding.qrc index f1168aef3b..f1168aef3b 100644 --- a/examples/qml/tutorials/extending/chapter3-bindings/chapter3-binding.qrc +++ b/examples/qml/tutorials/extending-qml/chapter3-bindings/chapter3-binding.qrc diff --git a/examples/qml/tutorials/extending/chapter3-bindings/chapter3-bindings.pro b/examples/qml/tutorials/extending-qml/chapter3-bindings/chapter3-bindings.pro index 6193f466c1..0c31592eeb 100644 --- a/examples/qml/tutorials/extending/chapter3-bindings/chapter3-bindings.pro +++ b/examples/qml/tutorials/extending-qml/chapter3-bindings/chapter3-bindings.pro @@ -6,7 +6,7 @@ SOURCES += piechart.cpp \ RESOURCES += chapter3-binding.qrc -DESTPATH = $$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending/chapter3-binding +DESTPATH = $$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending-qml/chapter3-binding target.path = $$DESTPATH qml.files = *.qml diff --git a/examples/qml/tutorials/extending/chapter3-bindings/main.cpp b/examples/qml/tutorials/extending-qml/chapter3-bindings/main.cpp index 4e719d2722..4e719d2722 100644 --- a/examples/qml/tutorials/extending/chapter3-bindings/main.cpp +++ b/examples/qml/tutorials/extending-qml/chapter3-bindings/main.cpp diff --git a/examples/qml/tutorials/extending/chapter3-bindings/piechart.cpp b/examples/qml/tutorials/extending-qml/chapter3-bindings/piechart.cpp index a63035033f..a63035033f 100644 --- a/examples/qml/tutorials/extending/chapter3-bindings/piechart.cpp +++ b/examples/qml/tutorials/extending-qml/chapter3-bindings/piechart.cpp diff --git a/examples/qml/tutorials/extending/chapter3-bindings/piechart.h b/examples/qml/tutorials/extending-qml/chapter3-bindings/piechart.h index 25e82d66cc..25e82d66cc 100644 --- a/examples/qml/tutorials/extending/chapter3-bindings/piechart.h +++ b/examples/qml/tutorials/extending-qml/chapter3-bindings/piechart.h diff --git a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/app.qml b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/app.qml index c757fdaedd..c757fdaedd 100644 --- a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/app.qml +++ b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/app.qml diff --git a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro index 1742334107..12dfbd6280 100644 --- a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro +++ b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro @@ -8,7 +8,7 @@ SOURCES += piechart.cpp \ RESOURCES += chapter4-customPropertyTypes.qrc -DESTPATH = $$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending/chapter4-customPropertyTypes +DESTPATH = $$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending-qml/chapter4-customPropertyTypes target.path = $$DESTPATH qml.files = *.qml diff --git a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.qrc b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/chapter4-customPropertyTypes.qrc index f1168aef3b..f1168aef3b 100644 --- a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.qrc +++ b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/chapter4-customPropertyTypes.qrc diff --git a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/main.cpp b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/main.cpp index fc59a11987..fc59a11987 100644 --- a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/main.cpp +++ b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/main.cpp diff --git a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/piechart.cpp index c1e2996e83..c1e2996e83 100644 --- a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp +++ b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/piechart.cpp diff --git a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.h b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/piechart.h index 9f0ea47eb9..9f0ea47eb9 100644 --- a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.h +++ b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/piechart.h diff --git a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/pieslice.cpp index 2afe82048f..2afe82048f 100644 --- a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp +++ b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/pieslice.cpp diff --git a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.h b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/pieslice.h index 4eef9bb6d1..4eef9bb6d1 100644 --- a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.h +++ b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/pieslice.h diff --git a/examples/qml/tutorials/extending/chapter5-listproperties/app.qml b/examples/qml/tutorials/extending-qml/chapter5-listproperties/app.qml index 68aa6e0c1d..68aa6e0c1d 100644 --- a/examples/qml/tutorials/extending/chapter5-listproperties/app.qml +++ b/examples/qml/tutorials/extending-qml/chapter5-listproperties/app.qml diff --git a/examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro b/examples/qml/tutorials/extending-qml/chapter5-listproperties/chapter5-listproperties.pro index ba51dd9093..67d1cd35c3 100644 --- a/examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro +++ b/examples/qml/tutorials/extending-qml/chapter5-listproperties/chapter5-listproperties.pro @@ -8,7 +8,7 @@ SOURCES += piechart.cpp \ RESOURCES += chapter5-listproperties.qrc -DESTPATH = $$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending/chapter5-listproperties +DESTPATH = $$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending-qml/chapter5-listproperties target.path = $$DESTPATH qml.files = *.qml diff --git a/examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.qrc b/examples/qml/tutorials/extending-qml/chapter5-listproperties/chapter5-listproperties.qrc index f1168aef3b..f1168aef3b 100644 --- a/examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.qrc +++ b/examples/qml/tutorials/extending-qml/chapter5-listproperties/chapter5-listproperties.qrc diff --git a/examples/qml/tutorials/extending/chapter5-listproperties/main.cpp b/examples/qml/tutorials/extending-qml/chapter5-listproperties/main.cpp index 8a4afcf96d..8a4afcf96d 100644 --- a/examples/qml/tutorials/extending/chapter5-listproperties/main.cpp +++ b/examples/qml/tutorials/extending-qml/chapter5-listproperties/main.cpp diff --git a/examples/qml/tutorials/extending/chapter5-listproperties/piechart.cpp b/examples/qml/tutorials/extending-qml/chapter5-listproperties/piechart.cpp index 9fb61d9cd8..9fb61d9cd8 100644 --- a/examples/qml/tutorials/extending/chapter5-listproperties/piechart.cpp +++ b/examples/qml/tutorials/extending-qml/chapter5-listproperties/piechart.cpp diff --git a/examples/qml/tutorials/extending/chapter5-listproperties/piechart.h b/examples/qml/tutorials/extending-qml/chapter5-listproperties/piechart.h index 55488f4900..55488f4900 100644 --- a/examples/qml/tutorials/extending/chapter5-listproperties/piechart.h +++ b/examples/qml/tutorials/extending-qml/chapter5-listproperties/piechart.h diff --git a/examples/qml/tutorials/extending/chapter5-listproperties/pieslice.cpp b/examples/qml/tutorials/extending-qml/chapter5-listproperties/pieslice.cpp index 52b409aa22..52b409aa22 100644 --- a/examples/qml/tutorials/extending/chapter5-listproperties/pieslice.cpp +++ b/examples/qml/tutorials/extending-qml/chapter5-listproperties/pieslice.cpp diff --git a/examples/qml/tutorials/extending/chapter5-listproperties/pieslice.h b/examples/qml/tutorials/extending-qml/chapter5-listproperties/pieslice.h index f324179481..f324179481 100644 --- a/examples/qml/tutorials/extending/chapter5-listproperties/pieslice.h +++ b/examples/qml/tutorials/extending-qml/chapter5-listproperties/pieslice.h diff --git a/examples/qml/tutorials/extending/chapter6-plugins/app.pro b/examples/qml/tutorials/extending-qml/chapter6-plugins/app.pro index c55db00d27..c55db00d27 100644 --- a/examples/qml/tutorials/extending/chapter6-plugins/app.pro +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/app.pro diff --git a/examples/qml/tutorials/extending/chapter6-plugins/app.qml b/examples/qml/tutorials/extending-qml/chapter6-plugins/app.qml index d5a474b8d3..d5a474b8d3 100644 --- a/examples/qml/tutorials/extending/chapter6-plugins/app.qml +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/app.qml diff --git a/examples/qml/tutorials/extending/chapter6-plugins/app.qrc b/examples/qml/tutorials/extending-qml/chapter6-plugins/app.qrc index f1168aef3b..f1168aef3b 100644 --- a/examples/qml/tutorials/extending/chapter6-plugins/app.qrc +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/app.qrc diff --git a/examples/qml/tutorials/extending/chapter6-plugins/chapter6-plugins.pro b/examples/qml/tutorials/extending-qml/chapter6-plugins/chapter6-plugins.pro index f858c80876..f858c80876 100644 --- a/examples/qml/tutorials/extending/chapter6-plugins/chapter6-plugins.pro +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/chapter6-plugins.pro diff --git a/examples/qml/tutorials/extending/chapter6-plugins/import/chartsplugin.cpp b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/chartsplugin.cpp index fea4c1aa85..fea4c1aa85 100644 --- a/examples/qml/tutorials/extending/chapter6-plugins/import/chartsplugin.cpp +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/chartsplugin.cpp diff --git a/examples/qml/tutorials/extending/chapter6-plugins/import/chartsplugin.h b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/chartsplugin.h index d768306967..d768306967 100644 --- a/examples/qml/tutorials/extending/chapter6-plugins/import/chartsplugin.h +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/chartsplugin.h diff --git a/examples/qml/tutorials/extending/chapter6-plugins/import/import.pro b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/import.pro index 83cfb96ab5..cefcf3b477 100644 --- a/examples/qml/tutorials/extending/chapter6-plugins/import/import.pro +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/import.pro @@ -13,7 +13,7 @@ SOURCES += piechart.cpp \ pieslice.cpp \ chartsplugin.cpp -DESTPATH=$$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending/chapter6-plugins/Charts +DESTPATH=$$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending-qml/chapter6-plugins/Charts target.path=$$DESTPATH qmldir.files=$$PWD/qmldir diff --git a/examples/qml/tutorials/extending/chapter6-plugins/import/piechart.cpp b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/piechart.cpp index 295bb8961d..295bb8961d 100644 --- a/examples/qml/tutorials/extending/chapter6-plugins/import/piechart.cpp +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/piechart.cpp diff --git a/examples/qml/tutorials/extending/chapter6-plugins/import/piechart.h b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/piechart.h index b37bcdd411..b37bcdd411 100644 --- a/examples/qml/tutorials/extending/chapter6-plugins/import/piechart.h +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/piechart.h diff --git a/examples/qml/tutorials/extending/chapter6-plugins/import/pieslice.cpp b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/pieslice.cpp index 52b409aa22..52b409aa22 100644 --- a/examples/qml/tutorials/extending/chapter6-plugins/import/pieslice.cpp +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/pieslice.cpp diff --git a/examples/qml/tutorials/extending/chapter6-plugins/import/pieslice.h b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/pieslice.h index 0b488b4835..0b488b4835 100644 --- a/examples/qml/tutorials/extending/chapter6-plugins/import/pieslice.h +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/pieslice.h diff --git a/examples/qml/tutorials/extending/chapter6-plugins/import/qmldir b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/qmldir index d9e8471b3c..d9e8471b3c 100644 --- a/examples/qml/tutorials/extending/chapter6-plugins/import/qmldir +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/qmldir diff --git a/examples/qml/tutorials/extending/chapter6-plugins/main.cpp b/examples/qml/tutorials/extending-qml/chapter6-plugins/main.cpp index 60d8c6cd7a..60d8c6cd7a 100644 --- a/examples/qml/tutorials/extending/chapter6-plugins/main.cpp +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/main.cpp diff --git a/examples/qml/tutorials/extending/extending.pro b/examples/qml/tutorials/extending-qml/extending-qml.pro index a665975382..a665975382 100644 --- a/examples/qml/tutorials/extending/extending.pro +++ b/examples/qml/tutorials/extending-qml/extending-qml.pro diff --git a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc index aab729656b..b593753d33 100644 --- a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc +++ b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc @@ -26,9 +26,9 @@ ****************************************************************************/ /*! -\page qml-extending-tutorial-index.html tutorial +\example tutorials/extending-qml \title Writing QML Extensions with C++ -\brief tutorial about extending QML with Qt C++ +\brief Tutorial about extending QML with Qt C++. The \l {Qt QML} module provides a set of APIs for extending QML through C++ extensions. You can write extensions to add your own QML types, extend existing @@ -38,33 +38,22 @@ This tutorial shows how to write a QML extension using C++ that includes core QML features, including properties, signals and bindings. It also shows how extensions can be deployed through plugins. -You can find the source code for this tutorial in \c Qt's -examples/qml/tutorials/extending directory. - -Tutorial chapters: - -\list 1 -\li \l{tutorials/extending/chapter1-basics}{Creating a New Type} -\li \l{tutorials/extending/chapter2-methods}{Connecting to C++ Methods and Signals} -\li \l{tutorials/extending/chapter3-bindings}{Property Binding} -\li \l{tutorials/extending/chapter4-customPropertyTypes}{Using Custom Property Types} -\li \l{tutorials/extending/chapter5-listproperties}{Using List Property Types} -\li \l{tutorials/extending/chapter6-plugins}{Writing an Extension Plugin} -\li \l{qml-extending-tutorial7.html}{In Summary} -\endlist - Many of the topics covered in this tutorial are documented in further detail in \l {qtqml-cppintegration-topic.html}{Integrating QML and C++} and its documentation sub-topics. In particular, you may be interested in the sub-topics \l{qtqml-cppintegration-exposecppattributes.html}{Exposing Attributes of C++ Classes to QML} and \l {qtqml-cppintegration-definetypes.html}{Defining QML Types from C++}. -*/ +\section1 Running the Tutorial Examples -/*! -\title Chapter 1: Creating a New Type +The code in this tutorial is available as an example project with subprojects +associated with each tutorial chapter. In \l{Qt Creator Manual}{Qt Creator}, open +the \uicontrol Welcome mode and select the tutorial from \uicontrol Examples. In +\uicontrol Edit mode, expand the \e extending-qml project, right-click on the +subproject (chapter) you want to run and select \uicontrol Run. -\example tutorials/extending/chapter1-basics +\section1 Chapter 1: Creating a New Type +\c extending-qml/chapter1-basics A common task when extending QML is to provide a new QML type that supports some custom functionality beyond what is provided by the built-in \l {Qt Quick QML Types}{Qt Quick types}. @@ -83,7 +72,7 @@ a version of 1.0. We want this \c PieChart type to be usable from QML like this: -\code +\badcode import Charts 1.0 PieChart { @@ -104,7 +93,7 @@ this new class must: Here is our \c PieChart class, defined in \c piechart.h: -\snippet tutorials/extending/chapter1-basics/piechart.h 0 +\snippet tutorials/extending-qml/chapter1-basics/piechart.h 0 The class inherits from QQuickPaintedItem because we want to override QQuickPaintedItem::paint() in perform drawing operations with the QPainter API. @@ -120,15 +109,15 @@ simply sets and returns the \c m_name and \c m_color values as appropriate, and implements \c paint() to draw a simple pie chart. It also turns off the QGraphicsItem::ItemHasNoContents flag to enable painting: -\snippet tutorials/extending/chapter1-basics/piechart.cpp 0 +\snippet tutorials/extending-qml/chapter1-basics/piechart.cpp 0 \dots 0 -\snippet tutorials/extending/chapter1-basics/piechart.cpp 1 +\snippet tutorials/extending-qml/chapter1-basics/piechart.cpp 1 Now that we have defined the \c PieChart type, we will use it from QML. The \c app.qml file creates a \c PieChart item and display the pie chart's details using a standard QML \l Text item: -\snippet tutorials/extending/chapter1-basics/app.qml 0 +\snippet tutorials/extending-qml/chapter1-basics/app.qml 0 Notice that although the color is specified as a string in QML, it is automatically converted to a QColor object for the PieChart \c color property. Automatic conversions are @@ -142,46 +131,46 @@ you don't register the type, \c app.qml won't be able to create a \c PieChart. Here is the application \c main.cpp: -\snippet tutorials/extending/chapter1-basics/main.cpp 0 +\snippet tutorials/extending-qml/chapter1-basics/main.cpp 0 This call to qmlRegisterType() registers the \c PieChart type as a type called "PieChart", in a type namespace called "Charts", with a version of 1.0. Lastly, we write a \c .pro project file that includes the files and the \c declarative library: -\quotefile tutorials/extending/chapter1-basics/chapter1-basics.pro +\quotefile tutorials/extending-qml/chapter1-basics/chapter1-basics.pro Now we can build and run the application: \image extending-tutorial-chapter1.png -Try it yourself with the code in Qt's \c examples/qml/tutorials/extending/chapter1-basics directory. -*/ - - -/*! -\title Chapter 2: Connecting to C++ Methods and Signals +\note You may see a warning \e {Expression ... depends on non-NOTIFYable properties: + PieChart::name}. This happens because we add a binding to the writable \c name + property, but haven't yet defined a notify signal for it. The QML engine therefore + cannot update the binding if the \c name value changes. This is addressed in + the following chapters. -\example tutorials/extending/chapter2-methods +\section1 Chapter 2: Connecting to C++ Methods and Signals +\c extending-qml/chapter2-methods Suppose we want \c PieChart to have a "clearChart()" method that erases the chart and then emits a "chartCleared" signal. Our \c app.qml would be able to call \c clearChart() and receive \c chartCleared() signals like this: -\snippet tutorials/extending/chapter2-methods/app.qml 0 +\snippet tutorials/extending-qml/chapter2-methods/app.qml 0 \image extending-tutorial-chapter2.png To do this, we add a \c clearChart() method and a \c chartCleared() signal to our C++ class: -\snippet tutorials/extending/chapter2-methods/piechart.h 0 +\snippet tutorials/extending-qml/chapter2-methods/piechart.h 0 \dots -\snippet tutorials/extending/chapter2-methods/piechart.h 1 +\snippet tutorials/extending-qml/chapter2-methods/piechart.h 1 \dots -\snippet tutorials/extending/chapter2-methods/piechart.h 2 +\snippet tutorials/extending-qml/chapter2-methods/piechart.h 2 \dots -\snippet tutorials/extending/chapter2-methods/piechart.h 3 +\snippet tutorials/extending-qml/chapter2-methods/piechart.h 3 The use of Q_INVOKABLE makes the \c clearChart() method available to the Qt Meta-Object system, and in turn, to QML. Note that it could have @@ -191,23 +180,17 @@ slots are also callable from QML. Both of these approaches are valid. The \c clearChart() method simply changes the color to Qt::transparent, repaints the chart, then emits the \c chartCleared() signal: -\snippet tutorials/extending/chapter2-methods/piechart.cpp 0 +\snippet tutorials/extending-qml/chapter2-methods/piechart.cpp 0 Now when we run the application and click the window, the pie chart disappears, and the application outputs: -\code - The chart has been cleared +\badcode + qml: The chart has been cleared \endcode -Try out the example yourself with the updated code in Qt's \c examples/qml/tutorials/extending/chapter2-methods directory. - -*/ - -/*! -\title Chapter 3: Adding Property Bindings - -\example tutorials/extending/chapter3-bindings +\section1 Chapter 3: Adding Property Bindings +\c extending-qml/chapter3-bindings Property binding is a powerful feature of QML that allows values of different types to be synchronized automatically. It uses signals to notify and update @@ -216,7 +199,7 @@ other types' values when property values are changed. Let's enable property bindings for the \c color property. That means if we have code like this: -\snippet tutorials/extending/chapter3-bindings/app.qml 0 +\snippet tutorials/extending-qml/chapter3-bindings/app.qml 0 \image extending-tutorial-chapter3.png @@ -231,17 +214,17 @@ It's easy to enable property binding for the \c color property. We add a \l{Qt's Property System}{NOTIFY} feature to its Q_PROPERTY() declaration to indicate that a "colorChanged" signal is emitted whenever the value changes. -\snippet tutorials/extending/chapter3-bindings/piechart.h 0 +\snippet tutorials/extending-qml/chapter3-bindings/piechart.h 0 \dots -\snippet tutorials/extending/chapter3-bindings/piechart.h 1 +\snippet tutorials/extending-qml/chapter3-bindings/piechart.h 1 \dots -\snippet tutorials/extending/chapter3-bindings/piechart.h 2 +\snippet tutorials/extending-qml/chapter3-bindings/piechart.h 2 \dots -\snippet tutorials/extending/chapter3-bindings/piechart.h 3 +\snippet tutorials/extending-qml/chapter3-bindings/piechart.h 3 Then, we emit this signal in \c setPieSlice(): -\snippet tutorials/extending/chapter3-bindings/piechart.cpp 0 +\snippet tutorials/extending-qml/chapter3-bindings/piechart.cpp 0 It's important for \c setColor() to check that the color value has actually changed before emitting \c colorChanged(). This ensures the signal is not emitted unnecessarily and @@ -254,12 +237,9 @@ automatically updated and cannot be used as flexibly in QML. Also, since bindings are invoked so often and relied upon in QML usage, users of your custom QML types may see unexpected behavior if bindings are not implemented. -*/ - -/*! -\title Chapter 4: Using Custom Property Types +\section1 Chapter 4: Using Custom Property Types -\example tutorials/extending/chapter4-customPropertyTypes +\c extending-qml/chapter4-customPropertyTypes The \c PieChart type currently has a string-type property and a color-type property. It could have many other types of properties. For example, it could have an @@ -299,57 +279,49 @@ For example, let's replace the use of the \c property with a type called "PieSlice" that has a \c color property. Instead of assigning a color, we assign an \c PieSlice value which itself contains a \c color: -\snippet tutorials/extending/chapter4-customPropertyTypes/app.qml 0 +\snippet tutorials/extending-qml/chapter4-customPropertyTypes/app.qml 0 Like \c PieChart, this new \c PieSlice type inherits from QQuickPaintedItem and declares its properties with Q_PROPERTY(): -\snippet tutorials/extending/chapter4-customPropertyTypes/pieslice.h 0 +\snippet tutorials/extending-qml/chapter4-customPropertyTypes/pieslice.h 0 To use it in \c PieChart, we modify the \c color property declaration and associated method signatures: -\snippet tutorials/extending/chapter4-customPropertyTypes/piechart.h 0 +\snippet tutorials/extending-qml/chapter4-customPropertyTypes/piechart.h 0 \dots -\snippet tutorials/extending/chapter4-customPropertyTypes/piechart.h 1 +\snippet tutorials/extending-qml/chapter4-customPropertyTypes/piechart.h 1 \dots -\snippet tutorials/extending/chapter4-customPropertyTypes/piechart.h 2 +\snippet tutorials/extending-qml/chapter4-customPropertyTypes/piechart.h 2 \dots -\snippet tutorials/extending/chapter4-customPropertyTypes/piechart.h 3 +\snippet tutorials/extending-qml/chapter4-customPropertyTypes/piechart.h 3 There is one thing to be aware of when implementing \c setPieSlice(). The \c PieSlice is a visual item, so it must be set as a child of the \c PieChart using QQuickItem::setParentItem() so that the \c PieChart knows to paint this child item when its contents are drawn: -\snippet tutorials/extending/chapter4-customPropertyTypes/piechart.cpp 0 - +\snippet tutorials/extending-qml/chapter4-customPropertyTypes/piechart.cpp 0 Like the \c PieChart type, the \c PieSlice type has to be registered using qmlRegisterType() to be used from QML. As with \c PieChart, we'll add the type to the "Charts" type namespace, version 1.0: -\snippet tutorials/extending/chapter4-customPropertyTypes/main.cpp 0 +\snippet tutorials/extending-qml/chapter4-customPropertyTypes/main.cpp 0 \dots -\snippet tutorials/extending/chapter4-customPropertyTypes/main.cpp 1 +\snippet tutorials/extending-qml/chapter4-customPropertyTypes/main.cpp 1 \dots -\snippet tutorials/extending/chapter4-customPropertyTypes/main.cpp 2 - -Try it out with the code in Qt's \c examples/qml/tutorials/extending/chapter4-customPropertyTypes directory. - -*/ - +\snippet tutorials/extending-qml/chapter4-customPropertyTypes/main.cpp 2 -/*! -\title Chapter 5: Using List Property Types - -\example tutorials/extending/chapter5-listproperties +\section1 Chapter 5: Using List Property Types +\c extending-qml/chapter5-listproperties Right now, a \c PieChart can only have one \c PieSlice. Ideally a chart would have multiple slices, with different colors and sizes. To do this, we could have a \c slices property that accepts a list of \c PieSlice items: -\snippet tutorials/extending/chapter5-listproperties/app.qml 0 +\snippet tutorials/extending-qml/chapter5-listproperties/app.qml 0 \image extending-tutorial-chapter5.png @@ -360,11 +332,11 @@ function with a \c slices() function that returns a list of slices, and add an internal \c append_slice() function (discussed below). We also use a QList to store the internal list of slices as \c m_slices: -\snippet tutorials/extending/chapter5-listproperties/piechart.h 0 +\snippet tutorials/extending-qml/chapter5-listproperties/piechart.h 0 \dots -\snippet tutorials/extending/chapter5-listproperties/piechart.h 1 +\snippet tutorials/extending-qml/chapter5-listproperties/piechart.h 1 \dots -\snippet tutorials/extending/chapter5-listproperties/piechart.h 2 +\snippet tutorials/extending-qml/chapter5-listproperties/piechart.h 2 Although the \c slices property does not have an associated \c WRITE function, it is still modifiable because of the way QQmlListProperty works. @@ -373,7 +345,7 @@ return a QQmlListProperty value and indicate that the internal \c PieChart::append_slice() function is to be called whenever a request is made from QML to add items to the list: -\snippet tutorials/extending/chapter5-listproperties/piechart.cpp 0 +\snippet tutorials/extending-qml/chapter5-listproperties/piechart.cpp 0 The \c append_slice() function simply sets the parent item as before, and adds the new item to the \c m_slices list. As you can see, the append function for a @@ -384,15 +356,9 @@ The \c PieSlice class has also been modified to include \c fromAngle and \c angl properties and to draw the slice according to these values. This is a straightforward modification if you have read the previous pages in this tutorial, so the code is not shown here. -The complete code can be seen in the updated \c examples/qml/tutorials/extending/chapter5-listproperties directory. - -*/ - +\section1 Chapter 6: Writing an Extension Plugin -/*! -\title Chapter 6: Writing an Extension Plugin - -\example tutorials/extending/chapter6-plugins +\c extending-qml/chapter6-plugins Currently the \c PieChart and \c PieSlice types are used by \c app.qml, which is displayed using a QQuickView in a C++ application. An alternative @@ -408,17 +374,17 @@ and registers our QML types in the inherited \l{QQmlExtensionPlugin::}{registerT Here is the \c ChartsPlugin definition in \c chartsplugin.h: -\snippet tutorials/extending/chapter6-plugins/import/chartsplugin.h 0 +\snippet tutorials/extending-qml/chapter6-plugins/import/chartsplugin.h 0 And its implementation in \c chartsplugin.cpp: -\snippet tutorials/extending/chapter6-plugins/import/chartsplugin.cpp 0 +\snippet tutorials/extending-qml/chapter6-plugins/import/chartsplugin.cpp 0 Then, we write a \c .pro project file that defines the project as a plugin library and specifies with DESTDIR that library files should be built into a \c {../Charts} directory. -\quotefile tutorials/extending/chapter6-plugins/import/import.pro +\quotefile tutorials/extending-qml/chapter6-plugins/import/import.pro In this example, the \c Charts directory is located at the same level as the application that uses our new import module. This way, the QML engine will find our module @@ -434,7 +400,7 @@ to the same location as the plugin binary. The \c qmldir file declares the module name and the plugin that is made available by the module: -\quotefile tutorials/extending/chapter6-plugins/import/qmldir +\quotefile tutorials/extending-qml/chapter6-plugins/import/qmldir Now we have a QML module that can be imported to any application, provided that the QML engine knows where to find it. The example contains an executable that loads @@ -448,31 +414,29 @@ import path to the current directory so that it finds the \c qmldir file: The module "Charts" will be loaded by the QML engine, and the types provided by that module will be available for use in any QML document which imports it. -*/ - -/*! -\page qml-extending-tutorial7.html -\title Chapter 7: In Summary +\section1 Chapter 7: Summary In this tutorial, we've shown the basic steps for creating a QML extension: \list -\li Define new QML types by subclassing QObject and registering them with qmlRegisterType() -\li Add callable methods using Q_INVOKABLE or Qt slots, and connect to Qt signals with an \c onSignal syntax +\li Define new QML types by subclassing QObject and registering them with + qmlRegisterType() +\li Add callable methods using \l Q_INVOKABLE or Qt slots, and connect to Qt signals + with an \c onSignal syntax \li Add property bindings by defining \l{Qt's Property System}{NOTIFY} signals \li Define custom property types if the built-in types are not sufficient \li Define list property types using QQmlListProperty -\li Create a plugin library by defining a Qt plugin and writing a \c qmldir file +\li Create a plugin library by defining a Qt plugin and writing a + \l {Module Definition qmldir Files}{qmldir} file \endlist - The \l{Integrating QML and C++} documentation shows other useful features that can be added to QML extensions. For example, we could use \l{Default Properties}{default properties} to allow slices to be added without using the \c slices property: -\code +\badcode PieChart { PieSlice { ... } PieSlice { ... } @@ -482,13 +446,11 @@ slices to be added without using the \c slices property: Or randomly add and remove slices from time to time using \l{Property Value Sources}{property value sources}: -\code +\badcode PieChart { PieSliceRandomizer on slices {} } \endcode - -See the \l{Integrating QML and C++} documentation for more information. - +\sa {Integrating QML and C++} */ |