1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-06 19:12:30 +01:00
ScreenPlay/ScreenPlayWidget/main.cpp

36 lines
1.0 KiB
C++
Raw Normal View History

#include <QApplication>
2018-03-08 22:03:05 +01:00
#include <QQmlApplicationEngine>
2018-03-21 18:56:58 +01:00
#include <QStringList>
2018-03-08 22:03:05 +01:00
#include "src/widgetwindow.h"
2018-03-21 18:56:58 +01:00
int main(int argc, char* argv[])
2018-03-08 22:03:05 +01:00
{
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
2018-12-01 18:01:17 +01:00
QApplication app(argc, argv);
2018-03-08 22:03:05 +01:00
2018-03-21 18:56:58 +01:00
QStringList argumentList = app.arguments();
// If we start with only one argument (path, appID, type),
// it means we want to test a single widget
if (argumentList.length() == 1) {
WidgetWindow spwmw("test", "appid", "qmlWidget");
return app.exec();
}
if (argumentList.length() != 4) {
2018-03-21 18:56:58 +01:00
return -3;
}
ScreenPlaySDK sdk(argumentList.at(2), argumentList.at(3));
2020-07-03 14:37:43 +02:00
// 1. Project path, 2. AppID, 3. Type
WidgetWindow spwmw(argumentList.at(1), argumentList.at(2), argumentList.at(3));
2018-03-08 22:03:05 +01:00
2020-01-10 15:26:53 +01:00
QObject::connect(&sdk, &ScreenPlaySDK::sdkDisconnected, &spwmw, &WidgetWindow::qmlExit);
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();
}