• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.8.3 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:
Inheritance graph
[legend]

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

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

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 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 also:
setCaseSensitive()

Definition at line 77 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 98 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 207 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 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()) [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 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-2012 The KDE developers.
Generated on Thu May 10 2012 20:53:13 by doxygen 1.8.0 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.8.3 API Reference

Skip menu "kdelibs-4.8.3 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