summaryrefslogtreecommitdiff
path: root/tests/tst_qml
diff options
context:
space:
mode:
authorMathias Hasselmann <mathias.hasselmann@kdab.com>2013-10-29 20:04:19 +0100
committerMathias Hasselmann <mathias.hasselmann@kdab.com>2013-10-29 20:04:19 +0100
commit2b291759186876e189de36d4404b40f7b696e013 (patch)
treeacd876d0c58afa4020abc745af7beadc330ad888 /tests/tst_qml
parent8dc7502ac0a86569945769d790ed79b4cd966079 (diff)
More work
Diffstat (limited to 'tests/tst_qml')
-rw-r--r--tests/tst_qml/tst_qml.pro13
-rw-r--r--tests/tst_qml/tst_qmltest.cpp32
2 files changed, 45 insertions, 0 deletions
diff --git a/tests/tst_qml/tst_qml.pro b/tests/tst_qml/tst_qml.pro
new file mode 100644
index 0000000..9b9c406
--- /dev/null
+++ b/tests/tst_qml/tst_qml.pro
@@ -0,0 +1,13 @@
+QT += qml testlib
+
+QT -= gui
+
+TARGET = tst_qmltest
+CONFIG += console
+CONFIG -= app_bundle
+
+TEMPLATE = app
+
+
+SOURCES += tst_qmltest.cpp
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/tst_qml/tst_qmltest.cpp b/tests/tst_qml/tst_qmltest.cpp
new file mode 100644
index 0000000..38e5411
--- /dev/null
+++ b/tests/tst_qml/tst_qmltest.cpp
@@ -0,0 +1,32 @@
+#include <QString>
+#include <QtTest>
+#include <QCoreApplication>
+#include <QtQml>
+
+class QmlTest : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void testCase1()
+ {
+ QQmlEngine engine;
+ engine.addImportPath(qApp->applicationDirPath() + "/../../src");
+ qDebug() << (qApp->applicationDirPath() + "/../../src");
+
+ QStringListModel modelData;
+ QQmlContext *context = new QQmlContext(engine.rootContext());
+ context->setContextProperty("myModel", &modelData);
+
+ QQmlComponent component(&engine);
+ component.setData("import QtQuickStreamer 1.0\n"
+ "Pipeline { name: 'qmltest' }",
+ QUrl());
+ qDebug() << component.errors();
+ QObject *view = component.create(context);
+ }
+};
+
+QTEST_MAIN(QmlTest)
+
+#include "tst_qmltest.moc"