• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

KDEUI

Signals | Public Member Functions | Protected Member Functions | Properties

KRestrictedLine Class Reference

A line editor for restricted character sets. More...

#include <krestrictedline.h>

Inheritance diagram for KRestrictedLine:
Inheritance graph
[legend]

List of all members.

Signals

void invalidChar (int)

Public Member Functions

 KRestrictedLine (QWidget *parent=0)
 ~KRestrictedLine ()
void setValidChars (const QString &valid)
QString validChars () const

Protected Member Functions

void inputMethodEvent (QInputMethodEvent *e)
void keyPressEvent (QKeyEvent *e)

Properties

QString validChars

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.

krestrictedline.png

KDE Restricted Line Edit allowing all characters but 'o'

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

Definition at line 47 of file krestrictedline.h.


Constructor & Destructor Documentation

KRestrictedLine::KRestrictedLine ( QWidget *  parent = 0) [explicit]

Constructor.

Parameters:
parentpointer to the parent widget

Definition at line 36 of file krestrictedline.cpp.

KRestrictedLine::~KRestrictedLine ( )

Destructs the restricted line editor.

Definition at line 42 of file krestrictedline.cpp.


Member Function Documentation

void KRestrictedLine::inputMethodEvent ( QInputMethodEvent *  e) [protected]

Definition at line 72 of file krestrictedline.cpp.

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 48 of file krestrictedline.cpp.

void KRestrictedLine::setValidChars ( const QString &  valid)

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

Definition at line 94 of file krestrictedline.cpp.

QString KRestrictedLine::validChars ( ) const
Returns:
the string of acceptable characters.

Property Documentation

QString KRestrictedLine::validChars [read, write]

Definition at line 50 of file krestrictedline.h.


The documentation for this class was generated from the following files:
  • krestrictedline.h
  • krestrictedline.cpp

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal