Results 1 to 7 of 7

Thread: Accessing Environment Variables

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Accessing Environment Variables

    You can also use the third argument to the main() function, just remember you get a copy of environment there.

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

    mhoover (21st September 2006), sunil.thaha (21st September 2006)

  3. #2
    Join Date
    Jan 2006
    Location
    Maui, Hawaii
    Posts
    120
    Thanks
    65
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Accessing Environment Variables

    Thanks !! getenv works great.

    getenv_s must be windows because I can't compile with that command.

  4. #3
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Accessing Environment Variables

    You folks are Qt addicts aren't you? So , how about using qgetenv() instead? It provides portability and same features as the classic getenv() ...
    Current Qt projects : QCodeEdit, RotiDeCode

  5. The following user says thank you to fullmetalcoder for this useful post:

    mhoover (21st September 2006)

  6. #4
    Join Date
    Mar 2006
    Posts
    9
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Accessing Environment Variables

    The only issue about qgetenv is that it is only defined in Qt version 4.X.

  7. The following user says thank you to Zatraz for this useful post:

    mhoover (21st September 2006)

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
  •  
Qt is a trademark of The Qt Company.