diff options
author | mae <qt-info@nokia.com> | 2010-03-10 17:29:44 (GMT) |
---|---|---|
committer | mae <qt-info@nokia.com> | 2010-03-10 17:31:33 (GMT) |
commit | e5922ab126f3532483b18720ce893d6be826d50e (patch) | |
tree | 1d2913660c64847b8bade9ab89e159a8bdc0de63 /examples | |
parent | b8f9d43dc87054f4f0322a2d124beeb7aaf8bb8f (diff) | |
download | Qt-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.cpp | 2 | ||||
-rw-r--r-- | examples/declarative/extending/attached/main.cpp | 12 | ||||
-rw-r--r-- | examples/declarative/extending/binding/main.cpp | 15 | ||||
-rw-r--r-- | examples/declarative/extending/coercion/main.cpp | 8 | ||||
-rw-r--r-- | examples/declarative/extending/default/main.cpp | 8 | ||||
-rw-r--r-- | examples/declarative/extending/extended/main.cpp | 2 | ||||
-rw-r--r-- | examples/declarative/extending/grouped/main.cpp | 10 | ||||
-rw-r--r-- | examples/declarative/extending/properties/main.cpp | 4 | ||||
-rw-r--r-- | examples/declarative/extending/signal/main.cpp | 12 | ||||
-rw-r--r-- | examples/declarative/extending/valuesource/main.cpp | 14 |
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"); |