#include <QtCrypto>


Signals | |
| void | finished () |
Public Member Functions | |
| ConsolePrompt (QObject *parent=0) | |
| void | getChar () |
| void | getHidden (const QString &promptStr) |
| SecureArray | result () const |
| QChar | resultChar () const |
| void | waitForFinished () |
Friends | |
| class | Private |
This class provides a convenient way to get user input in a secure way, as shown below:
QCA::ConsolePrompt prompt; prompt.getHidden("Passphrase"); prompt.waitForFinished(); QCA:SecureArray pass = prompt.result();
keyloader.cpp, and saslclient.cpp.
| QCA::ConsolePrompt::ConsolePrompt | ( | QObject * | parent = 0 |
) |
Standard constructor.
| parent | the parent object for this object |
| void QCA::ConsolePrompt::finished | ( | ) | [signal] |
Emitted when the user input activity has been completed.
This corresponds to the provision of a string for getHidden() or a single character for getChar().
| void QCA::ConsolePrompt::getChar | ( | ) |
| void QCA::ConsolePrompt::getHidden | ( | const QString & | promptStr | ) |
Allow the user to enter data without it being echo'd to the terminal.
This is particularly useful for entry of passwords, passphrases and PINs.
| promptStr | the prompt to display to the user |
| SecureArray QCA::ConsolePrompt::result | ( | ) | const |
Obtain the result of the user input.
This method is usually called to obtain data from the user that was requested by the getHidden() call.
| QChar QCA::ConsolePrompt::resultChar | ( | ) | const |
Obtain the result of the user input.
This method is usually called to obtain data from the user that was requested by the getChar() call.
| void QCA::ConsolePrompt::waitForFinished | ( | ) |
Block waiting for user input.
You may wish to use the finished() signal to avoid blocking.
1.5.5