1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-05 18:42:29 +01:00
ScreenPlay/ScreenPlayWidget/main.cpp

49 lines
1.4 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
const QStringList argumentList = app.arguments();
2018-03-21 18:56:58 +01:00
// 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", { 0, 0 });
2020-08-10 21:09:45 +02:00
WidgetWindow spwmw("C:/Program Files (x86)/Steam/steamapps/workshop/content/672870/2136442401", "appid", "qmlWidget", { 0, 0 });
return app.exec();
}
if (argumentList.length() != 6) {
2018-03-21 18:56:58 +01:00
return -3;
}
bool okPosX = false;
int positionX = QVariant(argumentList.at(4)).toInt(&okPosX);
if (!okPosX) {
qWarning() << "Could not parse PositionX value to int: " << argumentList.at(4);
positionX = 0;
}
bool okPosY = false;
int positionY = QVariant(argumentList.at(5)).toInt(&okPosY);
if (!okPosY) {
qWarning() << "Could not parse PositionY value to int: " << argumentList.at(5);
positionY = 0;
}
2018-03-08 22:03:05 +01:00
WidgetWindow spwmw(
argumentList.at(1), // Project path,
argumentList.at(2), // AppID
argumentList.at(3), // Type
QPoint { positionX, positionY });
2018-11-24 14:28:02 +01:00
2018-03-08 22:03:05 +01:00
return app.exec();
}