KDE 4.9 PyKDE API Reference

- KDE's Python API

# KRestrictedLine Class Reference

`from PyKDE4.kdeui import *`

Inherits: KLineEdit → QLineEdit → QWidget → QObject

## Detailed Description

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.

"KDE Restricted Line Edit allowing all characters but 'o'"

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

## Signals
| invalidChar (int a0)
## Methods
| __init__ (self, QWidget parent=0)
| inputMethodEvent (self, QInputMethodEvent e)
| keyPressEvent (self, QKeyEvent e)
| setValidChars (self, QString valid)
QString | validChars (self)

## Signal Documentation

invalidChar | ( | int | a0
| ) |  |  |

Emitted when an invalid character was typed.

Signal syntax:
  `QObject.connect(source, SIGNAL("invalidChar(int)"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | QWidget | parent=0
| ) |  |  |

Constructor

Parameters:

  | parent | pointer to the parent widget

inputMethodEvent | ( | self, |
|  | QInputMethodEvent | e
| ) |  |  |

keyPressEvent | ( | self, |
|  | QKeyEvent | e
| ) |  |  |

setValidChars | ( | self, |
|  | QString | valid
| ) |  |  |

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

QString validChars | ( |  | self ) |

Returns:
  the string of acceptable characters.