summaryrefslogtreecommitdiffstats
path: root/examples/declarative/extending/extended/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/extending/extended/main.cpp')
-rw-r--r--examples/declarative/extending/extended/main.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/declarative/extending/extended/main.cpp b/examples/declarative/extending/extended/main.cpp
new file mode 100644
index 0000000..1006214
--- /dev/null
+++ b/examples/declarative/extending/extended/main.cpp
@@ -0,0 +1,22 @@
+#include <QApplication>
+#include <QmlEngine>
+#include <QmlComponent>
+#include <QDebug>
+#include <QLineEdit>
+
+int main(int argc, char ** argv)
+{
+ QApplication app(argc, argv);
+
+ QmlEngine engine;
+ QmlComponent component(&engine, ":example.qml");
+ QLineEdit *edit = qobject_cast<QLineEdit *>(component.create());
+
+ if (edit) {
+ edit->show();
+ return app.exec();
+ } else {
+ qWarning() << "An error occured";
+ return 0;
+ }
+}