summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2010-03-10 17:29:44 (GMT)
committermae <qt-info@nokia.com>2010-03-10 17:31:33 (GMT)
commite5922ab126f3532483b18720ce893d6be826d50e (patch)
tree1d2913660c64847b8bade9ab89e159a8bdc0de63 /examples
parentb8f9d43dc87054f4f0322a2d124beeb7aaf8bb8f (diff)
downloadQt-e5922ab126f3532483b18720ce893d6be826d50e.zip
Qt-e5922ab126f3532483b18720ce893d6be826d50e.tar.gz
Qt-e5922ab126f3532483b18720ce893d6be826d50e.tar.bz2
Document - and use - the qmlRegisterXXX template functions
This commit removes the obsolete QML_REGISTER_TYPE macros.
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/extending/adding/main.cpp2
-rw-r--r--examples/declarative/extending/attached/main.cpp12
-rw-r--r--examples/declarative/extending/binding/main.cpp15
-rw-r--r--examples/declarative/extending/coercion/main.cpp8
-rw-r--r--examples/declarative/extending/default/main.cpp8
-rw-r--r--examples/declarative/extending/extended/main.cpp2
-rw-r--r--examples/declarative/extending/grouped/main.cpp10
-rw-r--r--examples/declarative/extending/properties/main.cpp4
-rw-r--r--examples/declarative/extending/signal/main.cpp12
-rw-r--r--examples/declarative/extending/valuesource/main.cpp14
10 files changed, 43 insertions, 44 deletions
diff --git a/examples/declarative/extending/adding/main.cpp b/examples/declarative/extending/adding/main.cpp
index 76e0736..b9e5aa3 100644
--- a/examples/declarative/extending/adding/main.cpp
+++ b/examples/declarative/extending/adding/main.cpp
@@ -48,7 +48,7 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QML_REGISTER_TYPE(People, 1,0, Person, Person);
+ qmlRegisterType<Person>("People", 1,0, "Person");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/attached/main.cpp b/examples/declarative/extending/attached/main.cpp
index 684d8d3..fd2d525 100644
--- a/examples/declarative/extending/attached/main.cpp
+++ b/examples/declarative/extending/attached/main.cpp
@@ -49,12 +49,12 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QML_REGISTER_NOCREATE_TYPE(BirthdayPartyAttached);
- QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
- QML_REGISTER_NOCREATE_TYPE(ShoeDescription);
- QML_REGISTER_NOCREATE_TYPE(Person);
- QML_REGISTER_TYPE(People, 1,0, Boy, Boy);
- QML_REGISTER_TYPE(People, 1,0, Girl, Girl);
+ qmlRegisterType<BirthdayPartyAttached>();
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<ShoeDescription>();
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/binding/main.cpp b/examples/declarative/extending/binding/main.cpp
index 873f8c9..ce6c50d 100644
--- a/examples/declarative/extending/binding/main.cpp
+++ b/examples/declarative/extending/binding/main.cpp
@@ -49,14 +49,13 @@
int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
-
- QML_REGISTER_NOCREATE_TYPE(BirthdayPartyAttached);
- QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
- QML_REGISTER_TYPE(People, 1,0, HappyBirthday, HappyBirthday);
- QML_REGISTER_NOCREATE_TYPE(ShoeDescription);
- QML_REGISTER_NOCREATE_TYPE(Person);
- QML_REGISTER_TYPE(People, 1,0, Boy, Boy);
- QML_REGISTER_TYPE(People, 1,0, Girl, Girl);
+ qmlRegisterType<BirthdayPartyAttached>();
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<HappyBirthday>("People", 1,0, "HappyBirthday");
+ qmlRegisterType<ShoeDescription>();
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/coercion/main.cpp b/examples/declarative/extending/coercion/main.cpp
index 1e2209f..312aff9 100644
--- a/examples/declarative/extending/coercion/main.cpp
+++ b/examples/declarative/extending/coercion/main.cpp
@@ -49,12 +49,12 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
// ![0]
- QML_REGISTER_NOCREATE_TYPE(Person);
+ qmlRegisterType<Person>();
// ![0]
- QML_REGISTER_TYPE(People, 1,0, Boy, Boy);
- QML_REGISTER_TYPE(People, 1,0, Girl, Girl);
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/default/main.cpp b/examples/declarative/extending/default/main.cpp
index 7d7f8a1..06282ad 100644
--- a/examples/declarative/extending/default/main.cpp
+++ b/examples/declarative/extending/default/main.cpp
@@ -49,10 +49,10 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
- QML_REGISTER_NOCREATE_TYPE(Person);
- QML_REGISTER_TYPE(People, 1,0, Boy, Boy);
- QML_REGISTER_TYPE(People, 1,0, Girl, Girl);
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/extended/main.cpp b/examples/declarative/extending/extended/main.cpp
index 5cbeea3..ca7242d 100644
--- a/examples/declarative/extending/extended/main.cpp
+++ b/examples/declarative/extending/extended/main.cpp
@@ -49,7 +49,7 @@ int main(int argc, char ** argv)
{
QApplication app(argc, argv);
- QML_REGISTER_EXTENDED_TYPE(People, 1,0, QLineEdit, QLineEdit, LineEditExtension);
+ qmlRegisterExtendedType<QLineEdit, LineEditExtension>("People", 1,0, "QLineEdit");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/grouped/main.cpp b/examples/declarative/extending/grouped/main.cpp
index 15a0bb5..b383a8b 100644
--- a/examples/declarative/extending/grouped/main.cpp
+++ b/examples/declarative/extending/grouped/main.cpp
@@ -49,11 +49,11 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
- QML_REGISTER_NOCREATE_TYPE(ShoeDescription);
- QML_REGISTER_NOCREATE_TYPE(Person);
- QML_REGISTER_TYPE(People, 1,0, Boy, Boy);
- QML_REGISTER_TYPE(People, 1,0, Girl, Girl);
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<ShoeDescription>();
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/properties/main.cpp b/examples/declarative/extending/properties/main.cpp
index ce69ad2..350f8bd 100644
--- a/examples/declarative/extending/properties/main.cpp
+++ b/examples/declarative/extending/properties/main.cpp
@@ -49,8 +49,8 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
- QML_REGISTER_TYPE(People, 1,0, Person, Person);
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<Person>("People", 1,0, "Person");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/signal/main.cpp b/examples/declarative/extending/signal/main.cpp
index afc1a66..1b23a46 100644
--- a/examples/declarative/extending/signal/main.cpp
+++ b/examples/declarative/extending/signal/main.cpp
@@ -49,12 +49,12 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QML_REGISTER_NOCREATE_TYPE(BirthdayPartyAttached);
- QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
- QML_REGISTER_NOCREATE_TYPE(ShoeDescription);
- QML_REGISTER_NOCREATE_TYPE(Person);
- QML_REGISTER_TYPE(People, 1,0, Boy, Boy);
- QML_REGISTER_TYPE(People, 1,0, Girl, Girl);
+ qmlRegisterType<BirthdayPartyAttached>();
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<ShoeDescription>();
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/valuesource/main.cpp b/examples/declarative/extending/valuesource/main.cpp
index 873f8c9..2574917 100644
--- a/examples/declarative/extending/valuesource/main.cpp
+++ b/examples/declarative/extending/valuesource/main.cpp
@@ -50,13 +50,13 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QML_REGISTER_NOCREATE_TYPE(BirthdayPartyAttached);
- QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
- QML_REGISTER_TYPE(People, 1,0, HappyBirthday, HappyBirthday);
- QML_REGISTER_NOCREATE_TYPE(ShoeDescription);
- QML_REGISTER_NOCREATE_TYPE(Person);
- QML_REGISTER_TYPE(People, 1,0, Boy, Boy);
- QML_REGISTER_TYPE(People, 1,0, Girl, Girl);
+ qmlRegisterType<BirthdayPartyAttached>();
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<HappyBirthday>("People", 1,0, "HappyBirthday");
+ qmlRegisterType<ShoeDescription>();
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");