2018-03-08 22:03:05 +01:00
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QQmlApplicationEngine>
|
2018-03-21 18:56:58 +01:00
|
|
|
#include <QStringList>
|
2018-03-08 22:03:05 +01:00
|
|
|
|
2019-03-24 16:52:07 +01:00
|
|
|
#include "src/widgetwindow.h"
|
2018-11-24 14:28:02 +01:00
|
|
|
#include "../ScreenPlaySDK/screenplaysdk.h"
|
2018-03-21 18:56:58 +01:00
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
2018-03-08 22:03:05 +01:00
|
|
|
{
|
2018-03-21 18:56:58 +01:00
|
|
|
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
2018-12-01 18:01:17 +01:00
|
|
|
|
2018-11-24 14:28:02 +01:00
|
|
|
ScreenPlaySDK sdk;
|
2018-03-08 22:03:05 +01:00
|
|
|
QGuiApplication app(argc, argv);
|
|
|
|
|
2018-03-21 18:56:58 +01:00
|
|
|
QStringList argumentList = app.arguments();
|
|
|
|
|
2019-03-27 18:38:36 +01:00
|
|
|
// If we start with only one argument (app path),
|
|
|
|
// it means we want to test a single widget
|
2019-03-24 16:52:07 +01:00
|
|
|
if (argumentList.length() == 1) {
|
2019-03-27 18:38:36 +01:00
|
|
|
WidgetWindow spwmw("test","appid" );
|
2019-03-24 16:52:07 +01:00
|
|
|
return app.exec();
|
|
|
|
}
|
|
|
|
|
2018-03-21 18:56:58 +01:00
|
|
|
if (argumentList.length() != 3) {
|
|
|
|
return -3;
|
|
|
|
}
|
|
|
|
|
2019-03-24 16:52:07 +01:00
|
|
|
WidgetWindow spwmw(argumentList.at(1), argumentList.at(2));
|
2018-03-08 22:03:05 +01:00
|
|
|
|
2019-03-24 16:52:07 +01:00
|
|
|
QObject::connect(&sdk, &ScreenPlaySDK::sdkDisconnected, &spwmw, &WidgetWindow::destroyThis);
|
|
|
|
QObject::connect(&sdk, &ScreenPlaySDK::incommingMessage, &spwmw, &WidgetWindow::messageReceived);
|
2018-11-24 14:28:02 +01:00
|
|
|
|
2018-03-08 22:03:05 +01:00
|
|
|
return app.exec();
|
|
|
|
}
|