summaryrefslogtreecommitdiffstats
path: root/examples/declarative/extending/properties/main.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-07-06 08:32:25 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-07-06 08:32:25 (GMT)
commitd641b621077d5cc81ce7b3de92af9a0f6d47f4d6 (patch)
treea6d367c55d3d2ec41cf8bf92a439c8cc14c717d8 /examples/declarative/extending/properties/main.cpp
parent6c7b88af807cbd2b4d824b8fca0f199ae1413432 (diff)
downloadQt-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.cpp26
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;
+}