Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Application change following the windows session username?

    General and Desktop
    2
    3
    392
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      filipdns last edited by

      Hello, my application have to be used by multi users but I need to allow the application functionality following the windows session username, do you know how can I get this user name?

      Thank you for your help

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        Hi
        As far as i know, there is no cross platform way to do it but various ways with tradeoffs.
        https://stackoverflow.com/questions/26552517/get-system-username-in-qt
        Maybe the getenv is the less fuss way.

        F 1 Reply Last reply Reply Quote 4
        • F
          filipdns @mrjj last edited by

          @mrjj great thank you!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post