Add --platform option. (#159)

This commit is contained in:
Ian Walton 2022-01-16 13:08:44 -05:00
parent 28ccf00fae
commit 5985c40a16

View File

@ -107,10 +107,15 @@ int main(int argc, char *argv[])
scaleOption.setValueName("scale");
scaleOption.setDefaultValue("auto");
auto platformOption = QCommandLineOption("platform", "Equivalant to QT_QPA_PLATFORM.");
platformOption.setValueName("platform");
platformOption.setDefaultValue("default");
auto devOption = QCommandLineOption("remote-debugging-port", "Port number for devtools.");
devOption.setValueName("port");
parser.addOption(scaleOption);
parser.addOption(devOption);
parser.addOption(platformOption);
char **newArgv = appendCommandLineArguments(argc, argv, g_qtFlags);
int newArgc = argc + g_qtFlags.size();
@ -155,6 +160,12 @@ int main(int argc, char *argv[])
else if (scale != "none")
qputenv("QT_SCALE_FACTOR", scale.toUtf8());
auto platform = parser.value("platform");
if (!(platform.isEmpty() || platform == "default"))
{
qputenv("QT_QPA_PLATFORM", platform.toUtf8());
}
QApplication app(newArgc, newArgv);
app.setApplicationName("Jellyfin Media Player");