Results 1 to 2 of 2

Thread: Looking to NOT echo input when writing to stdin

  1. #1
    Join Date
    Aug 2008
    Qt products
    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
    Warsaw, Poland
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits

    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


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.