# class KNewPasswordDialog

###

Module | kdeui
Namespace |
Class | KNewPasswordDialog
Inherits | KDialog

A password input dialog.

This dialog asks the user to enter a password.

Usage Exemple

    KNewPasswordDialog *dlg = new KNewPasswordDialog( parent );
    dlg->setPrompt( i18n( "Enter a password" );
    connect( dlg, SIGNAL( newPassword( const QString& ) ) , this, SLOT( setPassword( const QString &) ) );
    connect( dlg, SIGNAL( rejected() ) , this, SLOT( slotCancel() ) );
    dlg->show();

    KNewPasswordDialog dlg( parent );
    dlg.setPrompt( i18n( "Enter a password" );
    if( dlg.exec() )
    setPassword( dlg.password() );

Author Geert Jansen <jansen@kde.org> Author Olivier Goffart <ogoffart@kde.org>

### methods

- KNewPasswordDialog (parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QWidget | 0

  Constructs a password dialog.

  parent - Passed to lower level constructor.

- KNewPasswordDialog (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QWidget | 0

- accept ( )

  returns Nothing

  Internal

- allowEmptyPasswords ( )

  returns bool

  Allow empty passwords?

  Returns true if minimumPasswordLength() == 0

- checkPassword (a0)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  a0 | QString |

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

- maximumPasswordLength ( )

  returns int

  Maximum acceptable password length.

- minimumPasswordLength ( )

  returns int

  Minimum acceptable password length.

- newPassword (password)

  returns Nothing
  SIGNAL ("newPassword (const QString&)")

  Argument | Type | Default
  --- | --- | ---
  password | QString |

  The dialog has been accepted, and the new password is password

- password ( )

  returns QString

  Returns the password entered.

- passwordStrengthWarningLevel ( )

  returns int

  Password strength level below which a warning is given

- pixmap ( )

  returns QPixmap

  Returns the pixmap that appears next to the prompt in the dialog

- prompt ( )

  returns QString

  Returns the password prompt.

- reasonablePasswordLength ( )

  returns int

  Password length that is expected to be reasonably safe.

- setAllowEmptyPasswords (allowed)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  allowed | bool |

  Allow empty passwords? - Default: true

  same as setMinimumPasswordLength( allowed ? 0 : 1 )

- setMaximumPasswordLength (maxLength)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  maxLength | int |

  Maximum acceptable password length.

  maxLength: - The new maximum password length.

- setMinimumPasswordLength (minLength)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  minLength | int |

  Minimum acceptable password length.

  Default: 0

  minLength: - The new minimum password length

- setPasswordStrengthWarningLevel (warningLevel)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  warningLevel | int |

  Set the password strength level below which a warning is given Value is in the range 0 to 99. Empty passwords score 0; non-empty passwords score up to 100, depending on their length and whether they contain numbers, mixed case letters and punctuation.

  Default: 1 - warn if the password has no discernable strength whatsoever

  warningLevel: - The level below which a warning should be given.

- setPixmap (a0)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | QPixmap |

  Sets the pixmap that appears next to the prompt in the dialog. The default pixmap represent a simple key.

  the recommended size is KIconLoader.SizeHuge

- setPrompt (prompt)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  prompt | QString |

  Sets the password prompt.

- setReasonablePasswordLength (reasonableLength)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  reasonableLength | int |

  Password length that is expected to be reasonably safe.

  Used to compute the strength level

  Default: 8 - the standard UNIX password length

  reasonableLength: - The new reasonable password length.