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

KDEUI

Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
KRestrictedLine Class Reference

#include <krestrictedline.h>

Inheritance diagram for KRestrictedLine:
Inheritance graph
[legend]

Signals

void invalidChar (int)
 
- Signals inherited from KLineEdit
void aboutToShowContextMenu (QMenu *menu)
 
void clearButtonClicked ()
 
void completion (const QString &)
 
void completionBoxActivated (const QString &)
 
void completionModeChanged (KGlobalSettings::Completion)
 
void returnPressed (const QString &)
 
void substringCompletion (const QString &)
 
void textRotation (KCompletionBase::KeyBindingType)
 
QT_MOC_COMPAT void userTextChanged (const QString &)
 

Public Member Functions

 KRestrictedLine (QWidget *parent=0)
 
 ~KRestrictedLine ()
 
void setValidChars (const QString &valid)
 
QString validChars () const
 
- Public Member Functions inherited from KLineEdit
 KLineEdit (const QString &string, QWidget *parent=0)
 
 KLineEdit (QWidget *parent=0)
 
virtual ~KLineEdit ()
 
QSize clearButtonUsedSize () const
 
QString clickMessage () const
 
KCompletionBox * completionBox (bool create=true)
 
virtual void copy () const
 
void doCompletion (const QString &txt)
 
bool isClearButtonShown () const
 
bool isContextMenuEnabled () const
 
bool isSqueezedTextEnabled () const
 
QString originalText () const
 
void setClearButtonShown (bool show)
 
void setClickMessage (const QString &msg)
 
void setCompletionBox (KCompletionBox *box)
 
virtual void setCompletionMode (KGlobalSettings::Completion mode)
 
void setCompletionModeDisabled (KGlobalSettings::Completion mode, bool disable=true)
 
virtual void setCompletionObject (KCompletion *, bool hsig=true)
 
virtual void setContextMenuEnabled (bool showMenu)
 
void setSqueezedTextEnabled (bool enable)
 
void setTrapReturnKey (bool trap)
 
void setUrl (const KUrl &url)
 
void setUrlDropsEnabled (bool enable)
 
bool trapReturnKey () const
 
bool urlDropsEnabled () const
 
QString userText () const
 
- Public Member Functions inherited from KCompletionBase
 KCompletionBase ()
 
virtual ~KCompletionBase ()
 
KGlobalSettings::Completion completionMode () const
 
KCompletion * completionObject (bool hsig=true)
 
KCompletion * compObj () const
 
bool emitSignals () const
 
KShortcut getKeyBinding (KeyBindingType item) const
 
bool handleSignals () const
 
bool isCompletionObjectAutoDeleted () const
 
void setAutoDeleteCompletionObject (bool autoDelete)
 
virtual void setCompletedItems (const QStringList &items, bool autoSuggest=true)=0
 
virtual void setCompletedText (const QString &text)=0
 
void setEnableSignals (bool enable)
 
virtual void setHandleSignals (bool handle)
 
bool setKeyBinding (KeyBindingType item, const KShortcut &key)
 
void useGlobalKeyBindings ()
 

Protected Member Functions

void inputMethodEvent (QInputMethodEvent *e)
 
void keyPressEvent (QKeyEvent *e)
 
- Protected Member Functions inherited from KLineEdit
bool autoSuggest () const
 
virtual void contextMenuEvent (QContextMenuEvent *)
 
virtual void create (WId=0, bool initializeWindow=true, bool destroyOldWindow=true)
 
QMenu * createStandardContextMenu ()
 
virtual void dropEvent (QDropEvent *)
 
virtual bool event (QEvent *)
 
virtual void focusInEvent (QFocusEvent *ev)
 
virtual void focusOutEvent (QFocusEvent *ev)
 
virtual void mouseDoubleClickEvent (QMouseEvent *)
 
virtual void mousePressEvent (QMouseEvent *)
 
virtual void mouseReleaseEvent (QMouseEvent *)
 
virtual void paintEvent (QPaintEvent *ev)
 
virtual void resizeEvent (QResizeEvent *)
 
virtual void setCompletedText (const QString &, bool)
 
void setUserSelection (bool userSelection)
 
- Protected Member Functions inherited from KCompletionBase
KCompletionBase * delegate () const
 
KeyBindingMap getKeyBindings () const
 
void setDelegate (KCompletionBase *delegate)
 
virtual void virtual_hook (int id, void *data)
 

Properties

QString validChars
 
- Properties inherited from KLineEdit
QString clickMessage
 
bool contextMenuEnabled
 
bool passwordMode
 
bool showClearButton
 
bool squeezedTextEnabled
 
bool trapEnterKeyEvent
 
bool urlDropsEnabled
 

Additional Inherited Members

- Public Types inherited from KCompletionBase
typedef QMap< KeyBindingType,
KShortcut > 
KeyBindingMap
 
enum  KeyBindingType { TextCompletion, PrevCompletionMatch, NextCompletionMatch, SubstringCompletion }
 
- Public Slots inherited from KLineEdit
virtual void clear ()
 
bool passwordMode () const
 
void rotateText (KCompletionBase::KeyBindingType type)
 
void setCompletedItems (const QStringList &items, bool autoSuggest=true)
 
virtual void setCompletedText (const QString &)
 
void setPasswordMode (bool b=true)
 
virtual void setReadOnly (bool)
 
void setSqueezedText (const QString &text)
 
virtual void setText (const QString &)
 
- Protected Slots inherited from KLineEdit
virtual void makeCompletion (const QString &)
 
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.

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@mi.nosp@m.wie..nosp@m.in-be.nosp@m.rlin.nosp@m..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)
protectedvirtual

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
readwrite

Definition at line 50 of file krestrictedline.h.


The documentation for this class was generated from the following files:
  • krestrictedline.h
  • krestrictedline.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal