|
|
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.
KRestrictedLine ( QWidget *parent=0, const char *name=0,
const QString& valid = QString::null)
| KRestrictedLine |
Constructor: This contructor takes three - optional - arguments. The first two parameters are simply passed on to QLineEdit.
Parameters:
parent | pointer to the parent widget |
name | pointer to the name of this widget |
valid | pointer to set of valid characters |
~KRestrictedLine ()
| ~KRestrictedLine |
Destructs the restricted line editor.
void setValidChars (const QString& valid)
| setValidChars |
All characters in the string valid are treated as acceptable characters.
QString validChars ()
| validChars |
[const]
Returns: the string of acceptable characters.
void invalidChar (int)
| invalidChar |
[signal]
Emitted when an invalid character was typed.
void keyPressEvent ( QKeyEvent *e )
| keyPressEvent |
[protected]
Reimplemented from KLineEdit for internal purposes..