Home · All Classes · Grouped Classes · Annotated · Functions

QPasswordDialog Class Reference

The QPasswordDialog class provides a dialog widget for entering a PIN code. More...

    #include <QPasswordDialog>

Inherits QDialog.

Public Types

Public Functions

Static Public Members

Additional Inherited Members


Detailed Description

The QPasswordDialog class provides a dialog widget for entering a PIN code.


Member Type Documentation

enum QPasswordDialog::InputMode

This enum describes the various input modes. The input mode for a dialog is used to specify how the password is returned (encrypted or plain text), as well as other UI differences if the dialog is shown using getPassword().

ConstantValueDescription
QPasswordDialog::Crypted0Password will be returned one-way encrypted (using MD5). If the dialog is shown using getPassword(), it will be maximized.
QPasswordDialog::Plain1Password will be returned as plain text. If the dialog is shown using getPassword(), it will not be maximized.
QPasswordDialog::Pin2Same as Plain, but '#' can also be used to accept the dialog.


Member Function Documentation

QPasswordDialog::QPasswordDialog ( QWidget * parent = 0, Qt::WFlags flags = 0 )

Constructs a new QPasswordDialog with the given parent and widget flags.

The input mode for the dialog is set by default to Crypted.

QPasswordDialog::~QPasswordDialog ()

Destroys the QPasswordDialog.

QString QPasswordDialog::getPassword ( QWidget * parent, const QString & prompt, InputMode mode = QPasswordDialog::Crypted, bool last = true )   [static]

Creates and displays a password dialog with the given parent and prompt; returns the entered password.

mode specifies whether the returned password is one-way encrypted (using MD5) or plain text. It also determines whether or not the dialog will be maximized. If the operation is required to accept more than one password -- for example, if accepting an old password and a new password -- set last to false to set the context label to 'Next'.

The returned value is a null string if the user cancels the operation, or an empty string if the user enters no password (but confirms the dialog).

QPasswordDialog::InputMode QPasswordDialog::inputMode () const

Returns the input mode used by the dialog.

See also setInputMode().

QString QPasswordDialog::password () const

Returns the password entered in the dialog.

If the input mode is Crypted, the password will be returned one-way encrypted (using MD5); otherwise it will be returned as plain text.

QString QPasswordDialog::prompt () const

Returns the prompt used by the dialog.

See also setPrompt().

void QPasswordDialog::reset ()

Resets any password previously entered in the dialog.

void QPasswordDialog::setInputMode ( QPasswordDialog::InputMode mode )

Sets the input mode for the dialog to mode.

See also inputMode().

void QPasswordDialog::setPrompt ( const QString & prompt )

Sets the prompt to be displayed by the dialog.

See also prompt().


Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3