KRestrictedLine Class Reference

`#include <krestrictedline.h>`

Inheritance diagram for KRestrictedLine:

## Signals

void | invalidChar (int)
Signals inherited from KLineEdit
void | completionBoxActivated (const QString &)
void | returnPressed (const QString &)
void | completion (const QString &)
void | substringCompletion (const QString &)
void | textRotation (KCompletionBase::KeyBindingType)
void | completionModeChanged (KGlobalSettings::Completion)
void | aboutToShowContextMenu (QPopupMenu *p)

## Public Member Functions

| KRestrictedLine (QWidget *parent=0, const char *name=0, const QString &valid=QString::null)
| ~KRestrictedLine ()
void | setValidChars (const QString &valid)
QString | validChars () const
Public Member Functions inherited from KLineEdit
| KLineEdit (const QString &string, QWidget *parent, const char *name=0)
| KLineEdit (QWidget *parent=0, const char *name=0)
virtual | ~KLineEdit ()
void | setURL (const KURL &url)
void | cursorAtEnd ()
virtual void | setCompletionMode (KGlobalSettings::Completion mode)
virtual void | setContextMenuEnabled (bool showMenu)
bool | isContextMenuEnabled () const
void | setURLDropsEnabled (bool enable)
bool | isURLDropsEnabled () const
void | setTrapReturnKey (bool trap)
bool | trapReturnKey () const
virtual bool | eventFilter (QObject *, QEvent *)
KCompletionBox * | completionBox (bool create=true)
virtual void | setCompletionObject (KCompletion *, bool hsig=true)
virtual void | copy () const
void | setEnableSqueezedText (bool enable)
bool | isSqueezedTextEnabled () const
QString | originalText () const
void | setCompletionBox (KCompletionBox *box)
void | setClickMessage (const QString &msg)
QString | clickMessage () const
Public Member Functions inherited from KCompletionBase
KCompletion * | completionObject (bool hsig=true)
virtual void | setHandleSignals (bool handle)
bool | isCompletionObjectAutoDeleted () const
void | setAutoDeleteCompletionObject (bool autoDelete)
void | setEnableSignals (bool enable)
bool | handleSignals () const
bool | emitSignals () const
KGlobalSettings::Completion | completionMode () const
bool | setKeyBinding (KeyBindingType item, const KShortcut &key)
const KShortcut & | getKeyBinding (KeyBindingType item) const
void | useGlobalKeyBindings ()
virtual void | setCompletedText (const QString &text)=0
virtual void | setCompletedItems (const QStringList &items)=0
KCompletion * | compObj () const

## Protected Member Functions

void | keyPressEvent (QKeyEvent *e)
virtual void | virtual_hook (int id, void *data)
Protected Member Functions inherited from KLineEdit
virtual void | resizeEvent (QResizeEvent *)
virtual void | mousePressEvent (QMouseEvent *)
virtual void | mouseDoubleClickEvent (QMouseEvent *)
virtual void | mouseReleaseEvent (QMouseEvent *)
virtual void | contextMenuEvent (QContextMenuEvent *)
virtual QPopupMenu * | createPopupMenu ()
virtual void | drawContents (QPainter *p)
virtual void | dropEvent (QDropEvent *)
virtual void | setCompletedText (const QString &, bool)
void | setUserSelection (bool userSelection)
virtual void | create (WId=0, bool initializeWindow=true, bool destroyOldWindow=true)
virtual void | focusInEvent (QFocusEvent *)
virtual void | focusOutEvent (QFocusEvent *)
bool | autoSuggest () const
Protected Member Functions inherited from KCompletionBase
KeyBindingMap | getKeyBindings () const
void | setDelegate (KCompletionBase *delegate)
KCompletionBase * | delegate () const

## Properties

QString | validChars
Properties inherited from KLineEdit
bool | contextMenuEnabled
bool | urlDropsEnabled
bool | trapEnterKeyEvent
bool | enableSqueezedText
QString | clickMessage

## Additional Inherited Members

Public Types inherited from KCompletionBase
enum | KeyBindingType
Public Slots inherited from KLineEdit
virtual void | setReadOnly (bool)
void | rotateText (KCompletionBase::KeyBindingType type)
virtual void | setCompletedText (const QString &)
void | setCompletedItems (const QStringList &items)
void | setCompletedItems (const QStringList &items, bool autoSuggest)
virtual void | clear ()
void | setSqueezedText (const QString &text)
virtual void | setText (const QString &)
Protected Slots inherited from KLineEdit
virtual void | makeCompletion (const QString &)
void | slotAboutToShow ()
void | slotCancelled ()
void | userCancelled (const QString &cancelText)

## 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.

Author
  Michael Wiedmann mw@mi.nosp@m.wie..nosp@m.in-be.nosp@m.rlin.nosp@m..de

Definition at line 44 of file krestrictedline.h.

## Constructor & Destructor Documentation

KRestrictedLine::KRestrictedLine | ( | QWidget * | parent = `0`,
|  | const char * | name = `0`,
|  | const QString & | valid = `QString::null`
| ) |  |

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

Definition at line 28 of file krestrictedline.cpp.

KRestrictedLine::~KRestrictedLine | ( |  | ) |

Destructs the restricted line editor.

Definition at line 36 of file krestrictedline.cpp.

## Member Function Documentation

void KRestrictedLine::invalidChar | ( | int |  | ) |

signal

Emitted when an invalid character was typed.

void KRestrictedLine::keyPressEvent | ( | QKeyEvent * | e | ) |

protected virtual

Re-implemented for internal reasons.

API not affected.

See QLineEdit::keyPressEvent().

Reimplemented from KLineEdit.

Definition at line 42 of file krestrictedline.cpp.

void KRestrictedLine::setValidChars | ( | const QString & | valid | ) |

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

Definition at line 68 of file krestrictedline.cpp.

QString KRestrictedLine::validChars | ( |  | ) | const

Returns
  the string of acceptable characters.

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

- krestrictedline.h
- krestrictedline.cpp

KDE Home | KDE Accessibility Home | Description of Access Keys