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

KDEUI

KListWidgetSearchLine Class Reference

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

#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 Member Functions

Qt::CaseSensitivity caseSensitive () const
 KListWidgetSearchLine (QWidget *parent=0, QListWidget *listWidget=0)
QListWidget * listWidget () const
virtual ~KListWidgetSearchLine ()

Protected Member Functions

virtual bool event (QEvent *event)
virtual bool itemMatches (const QListWidgetItem *item, const QString &s) const

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 36 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 61 of file klistwidgetsearchline.cpp.

KListWidgetSearchLine::~KListWidgetSearchLine (  )  [virtual]

Destroys the KListWidgetSearchLine.

Definition at line 69 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 also:
setCaseSensitive()

Definition at line 75 of file klistwidgetsearchline.cpp.

void KListWidgetSearchLine::clear (  )  [virtual, slot]

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

Reimplemented from KLineEdit.

Definition at line 122 of file klistwidgetsearchline.cpp.

bool KListWidgetSearchLine::event ( QEvent *  event  )  [protected, virtual]

Re-implemented for internal reasons.

API not affected.

Reimplemented from KLineEdit.

Definition at line 191 of file klistwidgetsearchline.cpp.

bool KListWidgetSearchLine::itemMatches ( const QListWidgetItem *  item,
const QString &  s 
) const [protected, virtual]

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 160 of file klistwidgetsearchline.cpp.

QListWidget * KListWidgetSearchLine::listWidget (  )  const

Returns the listWidget that is currently filtered by the search.

See also:
setListWidget()

Definition at line 80 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 136 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 141 of file klistwidgetsearchline.cpp.

void KListWidgetSearchLine::updateSearch ( const QString &  s = QString()  )  [virtual, slot]

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 88 of file klistwidgetsearchline.cpp.


The documentation for this class was generated from the following files:
  • klistwidgetsearchline.h
  • klistwidgetsearchline.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
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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