QApplication's constructor takes an (int argc, char**argv) to handle any Qt specific commandline arguments.
What if my app is in unicode? And I have a wchar_t** argv?
It seems a bit silly to create a char* copy of all the commandline args to pass to a library that is itself unicode.
Yes, it would be. If it wasn't for this note:
Warning: On Unix, this list is built from the argc and argv parameters passed to the constructor in the main() function. The string-data in argv is interpreted using QString::fromLocal8Bit(); hence it is not possible to pass, for example, Japanese command line arguments on a system that runs in a Latin1 locale. Most modern Unix systems do not have this limitation, as they are Unicode-based.
On NT-based Windows, this limitation does not apply either. On Windows, the arguments() are not built from the contents of argv/argc, as the content does not support Unicode. Instead, the arguments() are constructed from the return value of GetCommandLine(). As a result of this, the string given by arguments().at(0) might not be the program name on Windows, depending on how the application was started.
Admittedly, I don't get the word either.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With