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

KDEUI

Public Slots | Public Member Functions | Protected Member Functions
KListWidgetSearchLine Class Reference

#include <klistwidgetsearchline.h>

Inheritance diagram for KListWidgetSearchLine:
KLineEdit QLineEdit KCompletionBase

List of all members.

Public Slots

void clear ()
void setCaseSensitivity (Qt::CaseSensitivity cs)
void setListWidget (QListWidget *lv)
virtual void updateSearch (const QString &s=QString())
- Public Slots inherited from KLineEdit
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 &)

Public Member Functions

 KListWidgetSearchLine (QWidget *parent=0, QListWidget *listWidget=0)
virtual ~KListWidgetSearchLine ()
Qt::CaseSensitivity caseSensitive () const
QListWidget * listWidget () 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)
void setEnableSignals (bool enable)
virtual void setHandleSignals (bool handle)
bool setKeyBinding (KeyBindingType item, const KShortcut &key)
void useGlobalKeyBindings ()

Protected Member Functions

virtual bool event (QEvent *event)
virtual bool itemMatches (const QListWidgetItem *item, const QString &s) const
- 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 void focusInEvent (QFocusEvent *ev)
virtual void focusOutEvent (QFocusEvent *ev)
virtual void keyPressEvent (QKeyEvent *)
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)

Additional Inherited Members

- 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 &)
- Protected Slots inherited from KLineEdit
virtual void makeCompletion (const QString &)
void userCancelled (const QString &cancelText)
- Properties inherited from KLineEdit
QString clickMessage
bool contextMenuEnabled
bool passwordMode
bool showClearButton
bool squeezedTextEnabled
bool trapEnterKeyEvent
bool urlDropsEnabled

Detailed Description

This class makes it easy to add a search line for filtering the items in a listwidget based on a simple text search.

No changes to the application other than instantiating this class with an appropriate QListWidget should be needed.

Definition at line 37 of file klistwidgetsearchline.h.


Constructor & Destructor Documentation

KListWidgetSearchLine::KListWidgetSearchLine ( QWidget *  parent = 0,
QListWidget *  listWidget = 0 
)
explicit

Constructs a KListWidgetSearchLine with listWidget being the QListWidget to be filtered.

If listWidget is null then the widget will be disabled until a listWidget is set with setListWidget().

Definition at line 63 of file klistwidgetsearchline.cpp.

KListWidgetSearchLine::~KListWidgetSearchLine ( )
virtual

Destroys the KListWidgetSearchLine.

Definition at line 71 of file klistwidgetsearchline.cpp.


Member Function Documentation

Qt::CaseSensitivity KListWidgetSearchLine::caseSensitive ( ) const

Returns if the search is case sensitive.

This defaults to Qt::CaseInsensitive.

 @see setCaseSensitive()

Definition at line 77 of file klistwidgetsearchline.cpp.

void KListWidgetSearchLine::clear ( )
virtualslot

Clear line edit and empty hiddenItems, returning elements to listWidget.

Reimplemented from KLineEdit.

Definition at line 98 of file klistwidgetsearchline.cpp.

bool KListWidgetSearchLine::event ( QEvent *  event)
protectedvirtual

Re-implemented for internal reasons.

API not affected.

Reimplemented from KLineEdit.

Definition at line 207 of file klistwidgetsearchline.cpp.

bool KListWidgetSearchLine::itemMatches ( const QListWidgetItem *  item,
const QString &  s 
) const
protectedvirtual

Returns true if item matches the search s.

This will be evaluated based on the value of caseSensitive(). This can be overridden in subclasses to implement more complicated matching schemes.

Definition at line 142 of file klistwidgetsearchline.cpp.

QListWidget * KListWidgetSearchLine::listWidget ( ) const

Returns the listWidget that is currently filtered by the search.

See also:
setListWidget()

Definition at line 82 of file klistwidgetsearchline.cpp.

void KListWidgetSearchLine::setCaseSensitivity ( Qt::CaseSensitivity  cs)
slot

Make the search case sensitive or case insensitive.

See also:
caseSenstive()

Definition at line 112 of file klistwidgetsearchline.cpp.

void KListWidgetSearchLine::setListWidget ( QListWidget *  lv)
slot

Sets the QListWidget that is filtered by this search line.

If lv is null then the widget will be disabled.

See also:
listWidget()

Definition at line 117 of file klistwidgetsearchline.cpp.

void KListWidgetSearchLine::updateSearch ( const QString &  s = QString())
virtualslot

Updates search to only make visible the items that match s.

If s is null then the line edit's text will be used.

Definition at line 90 of file klistwidgetsearchline.cpp.


The documentation for this class was generated from the following files:
  • klistwidgetsearchline.h
  • klistwidgetsearchline.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 16 2013 17:49:45 by doxygen 1.8.1.1 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-4.10.5 API Reference

Skip menu "kdelibs-4.10.5 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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