Passing argc, argv to QGuiApplication

This commit is contained in:
Andrei Smirnov 2021-07-19 12:14:41 +03:00 committed by Michał
parent 387f002c63
commit fd1ed3eba8
2 changed files with 2 additions and 6 deletions

View File

@ -66,7 +66,7 @@ DOS_API void DOS_CALL dos_qapplication_initialize_opengl(void);
/// \brief Create a QGuiApplication /// \brief Create a QGuiApplication
/// \note The created QGuiApplication should be freed by calling dos_qguiapplication_delete() /// \note The created QGuiApplication should be freed by calling dos_qguiapplication_delete()
DOS_API void DOS_CALL dos_qguiapplication_create(void); DOS_API void DOS_CALL dos_qguiapplication_create(int argc, char** argv);
/// \brief Calls the QGuiApplication::exec() function of the current QGuiApplication /// \brief Calls the QGuiApplication::exec() function of the current QGuiApplication
/// \note A QGuiApplication should have been already created through dos_qguiapplication_create() /// \note A QGuiApplication should have been already created through dos_qguiapplication_create()

View File

@ -127,12 +127,8 @@ void dos_qapplication_initialize_opengl()
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
} }
void dos_qguiapplication_create() void dos_qguiapplication_create(int argc, char** argv)
{ {
static int argc = 1;
static char empty[1] = {0};
static char *argv[] = {empty};
register_meta_types(); register_meta_types();
new QGuiApplication(argc, argv); new QGuiApplication(argc, argv);