Results 1 to 8 of 8

Thread: portable getopt() functionality

  1. #1
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default portable getopt() functionality

    Does Qt support portable getopt()-like functionality? I'm trying to write up a server application that uses just the core and network modules (not the gui or event loop), and would greatly benefit from the unix getopt() functionality... but would rather not be restricted to unix. Thanks!
    Life without passion is death in disguise

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: portable getopt() functionality

    Maybe QCoreApplication::arguments() does the trick well enough? QStringList and QString are full of convenient methods for handling them..
    J-P Nurmi

  3. The following 2 users say thank you to jpn for this useful post:

    KShots (7th February 2007), marco.stanzani (14th March 2011)

  4. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: portable getopt() functionality


  5. #4
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: portable getopt() functionality

    Anything that uses QCoreApplication won't do... I'm hesitant to use Qt to begin with because I'm going for a small footprint, but I'm willing to do so if I can get away with just using the core and network modules (not gui, which QCoreApplication is part of).

    I could use QString for handling it, but that would effectively be writing up my own solution rather than using a pre-existing solution.
    Life without passion is death in disguise

  6. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: portable getopt() functionality

    Quote Originally Posted by KShots View Post
    Anything that uses QCoreApplication won't do... I'm hesitant to use Qt to begin with because I'm going for a small footprint, but I'm willing to do so if I can get away with just using the core and network modules (not gui, which QCoreApplication is part of).
    QCoreApplication is part of the QtCore module.
    J-P Nurmi

  7. #6
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: portable getopt() functionality

    Oops, my mistake. I was used to looking up QApplication, didn't notice that it was QCoreApplication. Thanks!
    Life without passion is death in disguise

  8. #7
    Join Date
    Feb 2011
    Posts
    31
    Thanks
    23
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: portable getopt() functionality

    they ask for customer login. is not freeware any longer then?

  9. #8
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: portable getopt() functionality

    It's not provided any longer, but there are alternatives such as the ones I posted in your other thread.

  10. The following user says thank you to squidge for this useful post:

    marco.stanzani (15th March 2011)

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.