class KPasswordDialog

A password input dialog. More...

Definition#include <kpassdlg.h>
InheritsKDialogBase
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Static Methods

Protected Methods

Protected Slots


Detailed Description

This dialog asks the user to enter a password. The functions you're probably interested in are the static methods, getPassword() and getNewPassword().

Usage example


 QCString password;
 int result = KPasswordDialog::getPassword(password, i18n("Password"));
 if (result == KPasswordDialog::Accepted)
     use(password);

Security notes

Keeping passwords in memory can be a potential security hole. You should handle this situation with care.

 KPasswordDialog (int type, QString prompt, bool enableKeep=false, int extraBttn=0)

KPasswordDialog ()

[virtual]

void  setPrompt (QString prompt)

Set the password prompt.

void  addLine (QString key, QString value)

Add a line of information to the dialog.

const char * password ()

[const]

Returns the password entered. The memory is freed in the destructor, so you should make a copy.

bool  keep ()

[const]

Returns true if the user wants to keep the password.

int  getPassword (QCString &password, QString prompt, int *keep=0L)

[static]

Pops up the dialog, asks the user for a password, and returns it.

Parameters:

Returns: Result code: Accepted or Rejected.

int  getNewPassword (QCString &password, QString prompt)

[static]

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.

Parameters:

Returns: Result code: Accepted or Rejected.

void  disableCoreDumps ()

[static]

Static helper funtion that disables core dumps.

enum Types {Password, NewPassword }

void  slotOk ()

[protected slot]

Reimplemented from KDialogBase.

void  slotCancel ()

[protected slot]

Reimplemented from KDialogBase.

void  slotKeep (bool)

[protected slot]

bool  checkPassword (const char *)

[protected virtual]

Virtual function that can be overridden to provide password checking in derived classes. It should return if the password is valid, false otherwise.