Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
None
-
6.4.0, 6.5.0 Beta1
-
Windows 10 21H2 (64bit). Visual Studio 2022.
-
-
a1b49152e (dev), 38a2fa5e8 (6.5)
Description
ActiveQt does in certain scenarios create QApplication with argc=0, which is invalid according to the doc. The pattern is furthermore causing problems for parameter-parsing code that assumes that the first argument will always be the executable name, like QtWebEngine (see QTBUG-110157).
Suggested fix
Update activeqt/control/qaxserverbase.cpp (line 886) and qtactiveqt/src/activeqt/control/qaxserver.cpp (line 442 & 1149) to instead pass all command-line arguments using the sample code below.
Example of how QApplication can be initialized using __argc & __argv:
QApplication(__argc, __argv);
Alternative Win32 code for retrieving all command-line arguments:
int argc = 0; wchar_t **argv = CommandLineToArgvW(GetCommandLineW(), &argc); LocalFree(argv); // TODO: Convert argv strings to ASCII