qca
QCA::ConsolePrompt Class Reference
[QCA user API]
Console prompt handler. More...
#include <QtCrypto>

Signals | |
| void | finished () |
Public Member Functions | |
| ConsolePrompt (QObject *parent=0) | |
| ~ConsolePrompt () | |
| void | getChar () |
| void | getHidden (const QString &promptStr) |
| SecureArray | result () const |
| QChar | resultChar () const |
| void | waitForFinished () |
Detailed Description
Console prompt handler.
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();
- Note:
- It is not necessary to use waitForFinished(), because you can just connect the finished() signal to a suitable method, however command line (console) applications often require waitForFinished().
Definition at line 855 of file qca_support.h.
Constructor & Destructor Documentation
| QCA::ConsolePrompt::ConsolePrompt | ( | QObject * | parent = 0 |
) |
Standard constructor.
- Parameters:
-
parent the parent object for this object
Definition at line 951 of file console.cpp.
| QCA::ConsolePrompt::~ConsolePrompt | ( | ) |
Definition at line 957 of file console.cpp.
Member Function Documentation
| 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().
- See also:
- waitForFinished
| void QCA::ConsolePrompt::getChar | ( | ) |
Obtain one character from the user.
- See also:
- resultChar() for how to get the input back.
Definition at line 974 of file console.cpp.
| 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.
- Parameters:
-
promptStr the prompt to display to the user
- See also:
- result() for how to get the input back.
Definition at line 962 of file console.cpp.
| 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.
Definition at line 1001 of file console.cpp.
| 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.
Definition at line 1006 of file console.cpp.
| void QCA::ConsolePrompt::waitForFinished | ( | ) |
Block waiting for user input.
You may wish to use the finished() signal to avoid blocking.
Definition at line 985 of file console.cpp.
The documentation for this class was generated from the following files:
KDE 4.4 API Reference