# kdeui Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# KPasswordEdit Class Reference

A safe password input widget. More...

`#include <kpassdlg.h>`

Inheritance diagram for KPasswordEdit:

[legend]
Collaboration diagram for KPasswordEdit:

[legend]
List of all members.

## Public Types

enum | EchoModes { OneStar, ThreeStars, NoEcho }

## Public Slots

virtual void | insert (const QString &)

## Public Member Functions

| KPasswordEdit (QWidget *parent=0, const char *name=0)
| KPasswordEdit (EchoMode echoMode, QWidget *parent, const char *name)
| KPasswordEdit (EchoModes echoMode, QWidget *parent, const char *name)
| KPasswordEdit (QWidget *parent, const char *name, int echoMode) KDE_DEPRECATED
| ~KPasswordEdit ()
const char * | password () const
void | erase ()
void | setMaxPasswordLength (int newLength)
int | maxPasswordLength () const

## Static Public Attributes

static const int | PassLen = 200

## Protected Member Functions

virtual void | keyPressEvent (QKeyEvent *)
virtual void | focusInEvent (QFocusEvent *e)
virtual bool | event (QEvent *e)

## Detailed Description

A safe password input widget.

Author:
  Geert Jansen <geertj@kde.org>

The widget uses the user's global "echo mode" setting.

Definition at line 39 of file kpassdlg.h.

## Constructor & Destructor Documentation

KPasswordEdit::KPasswordEdit | ( | QWidget * | parent = `0`,
|  | const char * | name = `0`
| ) |

| Constructs a password input widget using the user's global "echo mode" setting. Definition at line 105 of file kpassdlg.cpp. References KGlobal::config(), and KConfigBase::readEntry().

KPasswordEdit::KPasswordEdit | ( | EchoMode | echoMode,
|  | QWidget * | parent,
|  | const char * | name
| ) |

Constructs a password input widget using echoMode as "echo mode".

Note that echoMode is a QLineEdit::EchoMode.

Since:
  3.0

Definition at line 135 of file kpassdlg.cpp.

KPasswordEdit::KPasswordEdit | ( | EchoModes | echoMode,
|  | QWidget * | parent,
|  | const char * | name
| ) |

Constructs a password input widget using echoMode as "echo mode".

Note that echoMode is a KPasswordEdit::EchoModes.

Since:
  3.2

Definition at line 129 of file kpassdlg.cpp.

KPasswordEdit::KPasswordEdit | ( | QWidget * | parent,
|  | const char * | name,
|  | int | echoMode
| ) |

Deprecated:
  , will be removed in KDE 4.0 Creates a password input widget using echoMode as "echo mode".

Definition at line 123 of file kpassdlg.cpp.

KPasswordEdit::~KPasswordEdit | ( |  | ) |

| Destructs the widget. Definition at line 153 of file kpassdlg.cpp.

## Member Function Documentation

const char* KPasswordEdit::password | ( |  | ) | const`[inline]`

| Returns the password. The memory is freed in the destructor so you should make a copy. Definition at line 82 of file kpassdlg.h. Referenced by KPasswordDialog::slotOk().

void KPasswordEdit::erase | ( |  | ) |

| Erases the current password. Definition at line 177 of file kpassdlg.cpp. References QLineEdit::setText(). Referenced by KPasswordDialog::clearPassword().

void KPasswordEdit::setMaxPasswordLength | ( | int | newLength | ) |

Set the current maximum password length.

If a password longer than the limit specified is currently entered, it is truncated accordingly.

The length is capped to lie between 0 and 199 inclusive.

Parameters:

  | newLength: | The new maximum password length

Since:
  3.4

Definition at line 280 of file kpassdlg.cpp.

Referenced by KPasswordDialog::setMaximumPasswordLength().

int KPasswordEdit::maxPasswordLength | ( |  | ) | const

Returns the current maximum password length.

Since:
  3.4

Definition at line 293 of file kpassdlg.cpp.

Referenced by insert().

void KPasswordEdit::insert | ( | const QString & |  | ) | `[virtual, slot]`

| Reimplementation. Reimplemented from QLineEdit. Definition at line 160 of file kpassdlg.cpp. References QCString::length(), QString::local8Bit(), and maxPasswordLength().

The documentation for this class was generated from the following files:

- kpassdlg.h
- kpassdlg.cpp

This file is part of the documentation for kdeui Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:21:50 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003