From 42f2bf05bfd70afbd4cf81fa33b3eda895eb50cb Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 13 Jul 2020 21:51:55 -0400 Subject: [PATCH] Attempt to load a file if passed on the command line. --- OSBindings/Qt/main.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/OSBindings/Qt/main.cpp b/OSBindings/Qt/main.cpp index 89cbb1940..b8e70c547 100644 --- a/OSBindings/Qt/main.cpp +++ b/OSBindings/Qt/main.cpp @@ -14,11 +14,8 @@ int main(int argc, char *argv[]) format.setStencilBufferSize(0); QSurfaceFormat::setDefaultFormat(format); - // TODO: something with QCommandLineParser to accept a file to launch. - QApplication a(argc, argv); - - MainWindow *w = new MainWindow(); + MainWindow *const w = (argc > 1) ? new MainWindow(argv[1]) : new MainWindow(); w->setAttribute(Qt::WA_DeleteOnClose); w->show();