diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-06 08:32:25 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-06 08:32:25 (GMT) |
commit | d641b621077d5cc81ce7b3de92af9a0f6d47f4d6 (patch) | |
tree | a6d367c55d3d2ec41cf8bf92a439c8cc14c717d8 /examples/declarative/extending/properties/main.cpp | |
parent | 6c7b88af807cbd2b4d824b8fca0f199ae1413432 (diff) | |
download | Qt-d641b621077d5cc81ce7b3de92af9a0f6d47f4d6.zip Qt-d641b621077d5cc81ce7b3de92af9a0f6d47f4d6.tar.gz Qt-d641b621077d5cc81ce7b3de92af9a0f6d47f4d6.tar.bz2 |
Doc
Diffstat (limited to 'examples/declarative/extending/properties/main.cpp')
-rw-r--r-- | examples/declarative/extending/properties/main.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/declarative/extending/properties/main.cpp b/examples/declarative/extending/properties/main.cpp new file mode 100644 index 0000000..7b80914 --- /dev/null +++ b/examples/declarative/extending/properties/main.cpp @@ -0,0 +1,26 @@ +#include <QCoreApplication> +#include <QmlEngine> +#include <QmlComponent> +#include <QDebug> +#include "birthdayparty.h" +#include "person.h" + +int main(int argc, char ** argv) +{ + QCoreApplication app(argc, argv); + + QmlEngine engine; + QmlComponent component(&engine, QUrl::fromLocalFile(":example.qml")); + BirthdayParty *party = qobject_cast<BirthdayParty *>(component.create()); + + if (party && party->celebrant()) { + qWarning() << party->celebrant()->name() << "is having a birthday!"; + qWarning() << "They are inviting:"; + for (int ii = 0; ii < party->guests()->count(); ++ii) + qWarning() << " " << party->guests()->at(ii)->name(); + } else { + qWarning() << "An error occured"; + } + + return 0; +} |