# class KRestrictedLine

###

Module | kdeui
Namespace |
Class | KRestrictedLine
Inherits | KLineEdit

A line editor for restricted character sets.

The KRestrictedLine widget is a variant of QLineEdit which accepts only a restricted set of characters as input. All other characters will be discarded and the signal invalidChar() will be emitted for each of them.

Valid characters can be passed as a QString to the constructor or set afterwards via setValidChars(). The default key bindings of QLineEdit are still in effect.

This is almost like setting a QRegExpValidator on a KLineEdit; the difference is that with KRestrictedLine it can all be done in Qt designer.

Author Michael Wiedmann <mw@miwie.in-berlin.de>

### methods

- KRestrictedLine (parent)

  returns ctor
  KDE 4.1.0 and later only

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

  Constructor: This contructor takes three - optional - arguments. The first two parameters are simply passed on to QLineEdit.

  parent - pointer to the parent widget

- KRestrictedLine (a0)

  returns ctor
  before KDE 4.1.0 only

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

- invalidChar (a0)

  returns Nothing
  SIGNAL ("invalidChar (int)")

  Argument | Type | Default
  --- | --- | ---
  a0 | int |

  Emitted when an invalid character was typed.

- keyPressEvent (e)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  e | QKeyEvent |

- setValidChars (valid)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  valid | QString |

  All characters in the string valid are treated as acceptable characters.

- validChars ( )

  returns QString

  Returns the string of acceptable characters.