Commit bf0f1b78 authored by Thomas BOUTROUE's avatar Thomas BOUTROUE

Add ability to pass a network definition path as command-line argument

parent d815ef59
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QFileInfo>
#include "QtQmlTricksPlugin_UiElements.h"
#include "QtQmlTricksPlugin_SmartDataModels.h"
......@@ -21,6 +22,14 @@ int main (int argc, char * argv []) {
engine.load (QUrl ("qrc:///ui_testBench.qml"));
const QList<QObject *> rootObjects = engine.rootObjects ();
if (!rootObjects.isEmpty ()) {
const QStringList argsList = app.arguments ().mid (1);
for (const QString & arg : argsList) {
const QFileInfo info (arg);
if (info.exists () && info.isFile () && info.suffix ().toLower () == "qml") {
Manager::instance ().load (info.absoluteFilePath ());
break;
}
}
return app.exec ();
}
else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment