Results 1 to 2 of 2

Thread: Looking to NOT echo input when writing to stdin

  1. #1
    Join Date
    Aug 2008
    Posts
    15
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Looking to NOT echo input when writing to stdin

    ...Similar to getpass found on *nix...

    Basically I'm prompting for a password on the commandline and I would like the user to type the password in with out it actually echoing back to the console.

    Does anyone have any ideas that is crossplatform compatible(win/mac/linux)? Preferably using QT libs (I really don't want to have to link against anything else if I don't need to).

  2. #2
    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: Looking to NOT echo input when writing to stdin

    I'm afraid you have to directly access the terminal (i.e. using the readline library) to be able to do that. Qt can't get its hands on the console input until you press enter. I don't think you will find a portable solution to the problem.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. rebuild Qt +MinGW
    By Ghost in forum Installation and Deployment
    Replies: 1
    Last Post: 17th October 2008, 12:22
  2. Replies: 15
    Last Post: 21st April 2007, 17:46

Tags for this Thread

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.