KDEUI
KListWidgetSearchLine Class Reference
#include <klistwidgetsearchline.h>

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.
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 |
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] |
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.
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.
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: