Results 1 to 4 of 4

Thread: Internal Qt4 Standards for Command Line Arguments

  1. #1
    Join Date
    Jan 2009
    Location
    Camp Lejeune, NC
    Posts
    24
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Post Internal Qt4 Standards for Command Line Arguments

    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?
    Lenovo ThinkPad T400 - Gentoo Linux 2008.0 Hardened
    Apple iBook G3 - Gentoo Linux 2008.0 Desktop
    Linksys WRT54GL - OpenWrt Kamikaze
    Linksys WRT310N - Stock Crap

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Internal Qt4 Standards for Command Line Arguments

    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.
    It's nice to be important but it's more important to be nice.

  3. #3
    Join Date
    Jan 2009
    Location
    Camp Lejeune, NC
    Posts
    24
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Internal Qt4 Standards for Command Line Arguments

    Is there any reason why this parser should inherit QObject?
    Lenovo ThinkPad T400 - Gentoo Linux 2008.0 Hardened
    Apple iBook G3 - Gentoo Linux 2008.0 Desktop
    Linksys WRT54GL - OpenWrt Kamikaze
    Linksys WRT310N - Stock Crap

  4. #4
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Internal Qt4 Standards for Command Line Arguments

    No, I see no reason why this should be necessary.
    It's nice to be important but it's more important to be nice.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.