KIconViewSearchLine Class Reference
This class makes it easy to add a search line for filtering the items in a iconview based on a simple text search. More...
#include <kiconviewsearchline.h>
Inheritance diagram for KIconViewSearchLine:


Public Slots | |
virtual void | updateSearch (const QString &s=QString::null) |
void | setCaseSensitive (bool cs) |
void | setIconView (QIconView *iv) |
void | clear () |
Public Member Functions | |
KIconViewSearchLine (QWidget *parent=0, QIconView *iconView=0, const char *name=0) | |
KIconViewSearchLine (QWidget *parent, const char *name) | |
virtual | ~KIconViewSearchLine () |
bool | caseSensitive () const |
QIconView * | iconView () const |
Protected Slots | |
void | queueSearch (const QString &s) |
void | activateSearch () |
Protected Member Functions | |
virtual bool | itemMatches (const QIconViewItem *item, const QString &s) const |
void | init (QIconView *iconView=0) |
void | hideItem (QIconViewItem *item) |
void | showItem (QIconViewItem *item) |
Detailed Description
This class makes it easy to add a search line for filtering the items in a iconview based on a simple text search.No changes to the application other than instantiating this class with an appropriate QIconView should be needed.
- Since:
- 3.3
Definition at line 38 of file kiconviewsearchline.h.
Constructor & Destructor Documentation
|
Constructs a KIconViewSearchLine with iconView being the QIconView to be filtered. If iconView is null then the widget will be disabled until a iconview is set with setIconView(). Definition at line 57 of file kiconviewsearchline.cpp. References iconView(), and init(). |
|
Constructs a KIconViewSearchLine without any QIconView to filter. The QIconView object has to be set later with setIconView(). Definition at line 66 of file kiconviewsearchline.cpp. References init(). |
|
Destroys the KIconViewSearchLine.
Definition at line 73 of file kiconviewsearchline.cpp. References clear(). |
Member Function Documentation
|
Returns true if the search is case sensitive. This defaults to false.
Definition at line 79 of file kiconviewsearchline.cpp. Referenced by itemMatches(). |
|
Returns the iconview that is currently filtered by the search.
Definition at line 84 of file kiconviewsearchline.cpp. Referenced by init(), and KIconViewSearchLine(). |
|
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 92 of file kiconviewsearchline.cpp. References QValueList::begin(), QIconView::currentItem(), QValueList::end(), QIconView::ensureItemVisible(), QIconView::firstItem(), hideItem(), itemMatches(), QIconViewItem::nextItem(), showItem(), QIconView::sort(), and QLineEdit::text(). Referenced by activateSearch(). |
|
Make the search case sensitive or case insensitive.
Definition at line 164 of file kiconviewsearchline.cpp. |
|
Sets the QIconView that is filtered by this search line. If lv is null then the widget will be disabled.
Definition at line 169 of file kiconviewsearchline.cpp. |
|
Clear line edit and empty hiddenItems, returning elements to iconView.
Reimplemented from KLineEdit. Definition at line 137 of file kiconviewsearchline.cpp. References KLineEdit::clear(), endl(), kdDebug(), and showItem(). Referenced by ~KIconViewSearchLine(). |
|
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 190 of file kiconviewsearchline.cpp. References caseSensitive(). Referenced by updateSearch(). |
|
Do initialization common to both constructors.
Definition at line 202 of file kiconviewsearchline.cpp. References iconView(), queueSearch(), and QLineEdit::textChanged(). Referenced by KIconViewSearchLine(). |
|
Hide item.
Definition at line 222 of file kiconviewsearchline.cpp. References QIconView::takeItem(). Referenced by updateSearch(). |
|
Show item. Just unhide it, doesn't necessary show it on screen, for that use iconView->ensureItemVisible() Definition at line 231 of file kiconviewsearchline.cpp. References endl(), and kdDebug(). Referenced by clear(), and updateSearch(). |
|
When keys are pressed a new search string is created and a timer is activated. The most recent search is activated when this timer runs out if another key has not yet been pressed. This method makes
Definition at line 247 of file kiconviewsearchline.cpp. References activateSearch(), and QTimer::singleShot(). Referenced by init(). |
|
When the timer started with queueSearch() expires this slot is called. If there has been another timer started then this slot does nothing. However if there are no other pending searches this starts the icon view search.
Definition at line 254 of file kiconviewsearchline.cpp. References updateSearch(). Referenced by queueSearch(). |
The documentation for this class was generated from the following files: