aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/src-qml
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-10-06 09:55:43 -0400
committerKen Moore <ken@ixsystems.com>2017-10-06 09:55:43 -0400
commit93b24e060f223126fdb1facdd39177ba8a726828 (patch)
tree21a05056166254fea7c3a297deaac4a78c3c5fa5 /src-qt5/src-qml
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-93b24e060f223126fdb1facdd39177ba8a726828.tar.gz
lumina-93b24e060f223126fdb1facdd39177ba8a726828.tar.bz2
lumina-93b24e060f223126fdb1facdd39177ba8a726828.zip
Add a new testing utility for trying out QML files
Diffstat (limited to 'src-qt5/src-qml')
-rw-r--r--src-qt5/src-qml/test/main.cpp27
-rw-r--r--src-qt5/src-qml/test/test.pro5
2 files changed, 32 insertions, 0 deletions
diff --git a/src-qt5/src-qml/test/main.cpp b/src-qt5/src-qml/test/main.cpp
new file mode 100644
index 00000000..eabe7dc5
--- /dev/null
+++ b/src-qt5/src-qml/test/main.cpp
@@ -0,0 +1,27 @@
+#include <QDebug>
+#include <QApplication>
+#include <QQuickWidget>
+
+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";
+ QQuickWidget base;
+ qDebug() << "Resize base widget";
+ base.resize(1024,768);
+ qDebug() << "Load QML File:" << QMLFile;
+ base.setSource(QUrl::fromLocalFile(QMLFile));
+ qDebug() << "Start Event loop";
+ base.show();
+ int ret = A.exec();
+ qDebug() << " - Finished";
+ return ret;
+}
diff --git a/src-qt5/src-qml/test/test.pro b/src-qt5/src-qml/test/test.pro
new file mode 100644
index 00000000..4470adea
--- /dev/null
+++ b/src-qt5/src-qml/test/test.pro
@@ -0,0 +1,5 @@
+QT = core gui widgets quick quickwidgets
+
+TARGET = test
+
+SOURCES += main.cpp
bgstack15