PDA

View Full Version : Internal Qt4 Standards for Command Line Arguments



wswartzendruber
4th October 2009, 20:49
I'm trying to write a command line parser for use with Qt4 applications. Qt4's internal system matters because it seems QApplicatioin can recognize certain options. As far as I can tell, the standard is as follows:

-this-is-a-switch
-this-is-a-parameter value
-this-is-also-a-parameter=value

Is there official documentation on this subject somewhere? Can anyone comment on the above speculation?

axeljaeger
7th October 2009, 13:16
The already supported command line options are documented in the API docs of QApplication. There is no public usable interface for parsing command line options but you should use QStringList QCoreApplication::arguments () for implementing your own parser because it has already all arguments removed that Qt interprets itself.

wswartzendruber
8th October 2009, 00:42
Is there any reason why this parser should inherit QObject?

axeljaeger
8th October 2009, 07:16
No, I see no reason why this should be necessary.