class KListWidgetSearchLine |
|
|
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. |
|
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(). |
|
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 list widget search. See also queueSearch() |
|
Returns if the search is case sensitive. This defaults to Qt.CaseInsensitive. See also setCaseSensitive() |
|
Clear line edit and empty hiddenItems, returning elements to listWidget. |
|
Hide item. |
|
Do initialization common to both constructors. |
|
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. |
|
Returns the listWidget that is currently filtered by the search. See also setListWidget() |
|
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 s - the most recent search and starts the timer. Together with activateSearch() this makes it such that searches are not started until there is a short break in the users typing. See also activateSearch() |
|
Make the search case sensitive or case insensitive. See also caseSenstive() |
|
Sets the QListWidget that is filtered by this search line. If lv is null then the widget will be disabled. See also listWidget() |
|
Show item. Just unhide it, doesn't necessary show it on screen, for that use listWidget->scrollToItem() |
|
Updates search to only make visible the items that match s. If s is null then the line edit's text will be used. |