aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/src-qml/test/testlist.cpp
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-12-15 22:52:34 +0000
committerWeblate <noreply@weblate.org>2017-12-15 22:52:34 +0000
commit9155556b94b0fe25ef3d5398a7f70dcdc1841d69 (patch)
treeae5af06e4741c8767344be6d90a7307bcddb5b5d /src-qt5/src-qml/test/testlist.cpp
parentTranslated using Weblate (Russian) (diff)
parentAnother minor networking fix. (diff)
downloadlumina-9155556b94b0fe25ef3d5398a7f70dcdc1841d69.tar.gz
lumina-9155556b94b0fe25ef3d5398a7f70dcdc1841d69.tar.bz2
lumina-9155556b94b0fe25ef3d5398a7f70dcdc1841d69.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/src-qml/test/testlist.cpp')
-rw-r--r--src-qt5/src-qml/test/testlist.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src-qt5/src-qml/test/testlist.cpp b/src-qt5/src-qml/test/testlist.cpp
new file mode 100644
index 00000000..cc54c501
--- /dev/null
+++ b/src-qt5/src-qml/test/testlist.cpp
@@ -0,0 +1,37 @@
+#include <QDebug>
+#include <QApplication>
+#include <QQuickView>
+#include <QQmlEngine>
+#include <QQmlContext>
+#include <QObject>
+#include <QStringList>
+#include <QTimer>
+
+#include "ListData.h"
+
+int main(int argc, char** argv){
+ QString QMLFile;
+ for(int i=1; i<argc; i++){
+ if(QFile::exists(argv[i])){ QMLFile = QString(argv[i]); }
+ }
+ if(QMLFile.isEmpty()){
+ qDebug() << "No QML File provided!";
+ qDebug() << " Please provide a valid qml file path as an input argument";
+ return 1;
+ }
+ QApplication A(argc,argv);
+ qDebug() << "Creating base widget";
+ ListData data;
+ QQuickView base;
+ base.setResizeMode(QQuickView::SizeRootObjectToView);
+ qDebug() << "Resize base widget";
+ base.resize(1024,768);
+ base.engine()->rootContext()->setContextProperty("cppdata", &data);
+ qDebug() << "Load QML File:" << QMLFile;
+ base.setSource(QUrl::fromLocalFile(QMLFile));
+ qDebug() << "Start Event loop";
+ base.show();
+ int ret = A.exec();
+ qDebug() << " - Finished";
+ return ret;
+}
bgstack15