KPasswordDialog Class Reference
This dialog asks the user to enter a password. A password input dialog. More...
#include <kpassdlg.h>
Inheritance diagram for KPasswordDialog:


Public Types | |
enum | Types { Password, NewPassword } |
This enum distinguishes the two operation modes of this dialog:. More... | |
Public Member Functions | |
KPasswordDialog (Types type, bool enableKeep, int extraBttn, QWidget *parent=0, const char *name=0) | |
Constructs a password dialog. | |
KPasswordDialog (int type, QString prompt, bool enableKeep=false, int extraBttn=0) | |
This class or method is obsolete, it is provided for compatibility only. Variant of the previous constructor without the possibility to specify a parent. | |
virtual | ~KPasswordDialog () |
Destructs the password dialog. | |
void | setPrompt (QString prompt) |
Sets the password prompt. | |
QString | prompt () const |
Returns the password prompt. | |
void | addLine (QString key, QString value) |
Adds a line of information to the dialog. | |
const char * | password () const |
Returns the password entered. | |
bool | keep () const |
Returns true if the user wants to keep the password. | |
Static Public Member Functions | |
int | getPassword (QCString &password, QString prompt, int *keep=0L) |
Pops up the dialog, asks the user for a password, and returns it. | |
int | getNewPassword (QCString &password, QString prompt) |
Pops up the dialog, asks the user for a password and returns it. | |
void | disableCoreDumps () |
Static helper funtion that disables core dumps. | |
Protected Slots | |
void | slotOk () |
Activated when the Ok button has been clicked. | |
void | slotCancel () |
Activated when the Cancel button has been clicked. | |
void | slotKeep (bool) |
Protected Member Functions | |
virtual bool | checkPassword (const char *) |
Virtual function that can be overridden to provide password checking in derived classes. | |
virtual void | virtual_hook (int id, void *data) |
Detailed Description
This dialog asks the user to enter a password. A password input dialog.The functions you're probably interested in are the static methods, getPassword() and getNewPassword().
Usage example
Security notes
Keeping passwords in memory can be a potential security hole. You should handle this situation with care.
Definition at line 133 of file kpassdlg.h.
Member Enumeration Documentation
|
This enum distinguishes the two operation modes of this dialog:.
Definition at line 142 of file kpassdlg.h. |
Constructor & Destructor Documentation
|
Constructs a password dialog.
Definition at line 219 of file kpassdlg.cpp. References KStdAccel::name(). Referenced by getNewPassword(), and getPassword(). |
|
This class or method is obsolete, it is provided for compatibility only. Variant of the previous constructor without the possibility to specify a parent. May be removed in KDE 4.0 Definition at line 228 of file kpassdlg.cpp. References setPrompt(). |
|
Destructs the password dialog.
Definition at line 326 of file kpassdlg.cpp. |
Member Function Documentation
|
Sets the password prompt.
Definition at line 331 of file kpassdlg.cpp. References QLabel::setText(). Referenced by KPasswordDialog(). |
|
Returns the password prompt.
Definition at line 338 of file kpassdlg.cpp. References QLabel::text(). |
|
Adds a line of information to the dialog.
Definition at line 345 of file kpassdlg.cpp. References QGridLayout::addWidget(), KStdAccel::key(), QLabel::setAlignment(), and QLabel::setIndent(). |
|
Returns the password entered. The memory is freed in the destructor, so you should make a copy. Definition at line 197 of file kpassdlg.h. References KPasswordEdit::password(). Referenced by getNewPassword(), and getPassword(). |
|
Returns true if the user wants to keep the password.
Definition at line 202 of file kpassdlg.h. Referenced by getPassword(). |
|
Pops up the dialog, asks the user for a password, and returns it.
Definition at line 405 of file kpassdlg.cpp. References QDialog::exec(), keep(), KPasswordDialog(), password(), and Password. |
|
Pops up the dialog, asks the user for a password and returns it. The user has to enter the password twice to make sure it was entered correctly.
Definition at line 422 of file kpassdlg.cpp. References QDialog::exec(), KPasswordDialog(), NewPassword, and password(). |
|
Static helper funtion that disables core dumps.
Definition at line 434 of file kpassdlg.cpp. |
|
Activated when the Ok button has been clicked. The QDialog::accept() is activated. Reimplemented from KDialogBase. Definition at line 374 of file kpassdlg.cpp. References QDialog::accept(), checkPassword(), NewPassword, KPasswordEdit::password(), and KMessageBox::sorry(). |
|
Activated when the Cancel button has been clicked. The QDialog::reject() is activated in regular mode and QDialog::done( Cancel ) when in message box mode. Reimplemented from KDialogBase. Definition at line 392 of file kpassdlg.cpp. References QDialog::reject(). |
|
Virtual function that can be overridden to provide password checking in derived classes.
It should return Definition at line 247 of file kpassdlg.h. Referenced by slotOk(). |
The documentation for this class was generated from the following files: