KDE3Support
#include <k3listviewsearchline.h>
Public Slots | |
void | addListView (K3ListView *lv) |
void | removeListView (K3ListView *lv) |
void | setCaseSensitive (bool cs) |
void | setKeepParentsVisible (bool v) |
void | setListView (K3ListView *lv) |
void | setListViews (const QList< K3ListView * > &lv) |
void | setSearchColumns (const QList< int > &columns) |
virtual void | updateSearch (const QString &s=QString()) |
Public Slots inherited from KLineEdit | |
virtual void | clear () |
bool | passwordMode () const |
void | rotateText (KCompletionBase::KeyBindingType type) |
void | setCompletedItems (const QStringList &items, bool autoSuggest=true) |
virtual void | setCompletedText (const QString &) |
void | setPasswordMode (bool b=true) |
virtual void | setReadOnly (bool) |
void | setSqueezedText (const QString &text) |
virtual void | setText (const QString &) |
Protected Slots | |
void | activateSearch () |
void | queueSearch (const QString &search) |
Protected Slots inherited from KLineEdit | |
virtual void | makeCompletion (const QString &) |
void | userCancelled (const QString &cancelText) |
Protected Member Functions | |
virtual bool | canChooseColumnsCheck () |
virtual void | connectListView (K3ListView *) |
virtual void | contextMenuEvent (QContextMenuEvent *e) |
virtual void | disconnectListView (K3ListView *) |
virtual bool | itemMatches (const Q3ListViewItem *item, const QString &s) const |
virtual void | updateSearch (K3ListView *listView) |
Protected Member Functions inherited from KLineEdit | |
bool | autoSuggest () const |
virtual void | create (WId=0, bool initializeWindow=true, bool destroyOldWindow=true) |
QMenu * | createStandardContextMenu () |
virtual void | dropEvent (QDropEvent *) |
virtual bool | event (QEvent *) |
virtual void | focusInEvent (QFocusEvent *ev) |
virtual void | focusOutEvent (QFocusEvent *ev) |
virtual void | keyPressEvent (QKeyEvent *) |
virtual void | mouseDoubleClickEvent (QMouseEvent *) |
virtual void | mousePressEvent (QMouseEvent *) |
virtual void | mouseReleaseEvent (QMouseEvent *) |
virtual void | paintEvent (QPaintEvent *ev) |
virtual void | resizeEvent (QResizeEvent *) |
virtual void | setCompletedText (const QString &, bool) |
void | setUserSelection (bool userSelection) |
Additional Inherited Members | |
Signals inherited from KLineEdit | |
void | aboutToShowContextMenu (QMenu *menu) |
void | clearButtonClicked () |
void | completion (const QString &) |
void | completionBoxActivated (const QString &) |
void | completionModeChanged (KGlobalSettings::Completion) |
void | returnPressed (const QString &) |
void | substringCompletion (const QString &) |
void | textRotation (KCompletionBase::KeyBindingType) |
QT_MOC_COMPAT void | userTextChanged (const QString &) |
Properties inherited from KLineEdit | |
QString | clickMessage |
bool | contextMenuEnabled |
bool | passwordMode |
bool | showClearButton |
bool | squeezedTextEnabled |
bool | trapEnterKeyEvent |
bool | urlDropsEnabled |
Detailed Description
This class makes it easy to add a search line for filtering the items in listviews based on a simple text search.
No changes to the application other than instantiating this class with appropriate K3ListViews should be needed.
Definition at line 38 of file k3listviewsearchline.h.
Constructor & Destructor Documentation
K3ListViewSearchLine::K3ListViewSearchLine | ( | QWidget * | parent = 0 , |
K3ListView * | listView = 0 |
||
) |
Constructs a K3ListViewSearchLine with listView being the K3ListView to be filtered.
If listView is null then the widget will be disabled until listviews are set with setListView(), setListViews() or added with addListView().
Definition at line 64 of file k3listviewsearchline.cpp.
K3ListViewSearchLine::K3ListViewSearchLine | ( | QWidget * | parent, |
const QList< K3ListView * > & | listViews | ||
) |
Constructs a K3ListViewSearchLine with listViews being the list of pointers to K3ListViews to be filtered.
If listViews is empty then the widget will be disabled until listviews are set with setListView(), setListViews() or added with addListView().
Definition at line 78 of file k3listviewsearchline.cpp.
|
virtual |
Destroys the K3ListViewSearchLine.
Definition at line 92 of file k3listviewsearchline.cpp.
Member Function Documentation
|
protectedslot |
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 view search.
- See also
- queueSearch()
Definition at line 398 of file k3listviewsearchline.cpp.
|
slot |
Adds a K3ListView to the list of listviews filtered by this search line.
If lv is null then the widget will be disabled.
- See also
- listView(), setListViews(), removeListView()
Definition at line 133 of file k3listviewsearchline.cpp.
|
protectedvirtual |
Checks columns in all listviews and decides whether choosing columns to filter on makes any sense.
Returns false if either of the following is true:
- there are no listviews connected,
- the listviews have different numbers of columns,
- the listviews have only one column,
- the listviews differ in column labels.
Otherwise it returns true.
- See also
- setSearchColumns()
Definition at line 349 of file k3listviewsearchline.cpp.
bool K3ListViewSearchLine::caseSensitive | ( | ) | const |
Returns true if the search is case sensitive.
This defaults to false.
- See also
- setCaseSensitive()
Definition at line 97 of file k3listviewsearchline.cpp.
|
protectedvirtual |
Connects signals of this listview to the appropriate slots of the search line.
Definition at line 333 of file k3listviewsearchline.cpp.
|
protectedvirtual |
Re-implemented for internal reasons.
API not affected.
Reimplemented from KLineEdit.
Definition at line 281 of file k3listviewsearchline.cpp.
|
protectedvirtual |
Disconnects signals of a listviews from the search line.
Definition at line 341 of file k3listviewsearchline.cpp.
|
protectedvirtual |
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 252 of file k3listviewsearchline.cpp.
bool K3ListViewSearchLine::keepParentsVisible | ( | ) | const |
If this is true (the default) then the parents of matched items will also be shown.
- See also
- setKeepParentsVisible()
Definition at line 110 of file k3listviewsearchline.cpp.
K3ListView * K3ListViewSearchLine::listView | ( | ) | const |
Returns the listview that is currently filtered by the search.
If there are multiple listviews filtered, it returns 0.
- See also
- setListView(), listViews()
Definition at line 115 of file k3listviewsearchline.cpp.
const QList< K3ListView * > & K3ListViewSearchLine::listViews | ( | ) | const |
Returns the list of pointers to listviews that are currently filtered by the search.
- See also
- setListViews(), addListView(), listView()
Definition at line 123 of file k3listviewsearchline.cpp.
|
protectedslot |
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
- Parameters
-
search 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()
Definition at line 391 of file k3listviewsearchline.cpp.
|
slot |
Removes a K3ListView from the list of listviews filtered by this search line.
Does nothing if lv is 0 or is not filtered by the quick search line.
- See also
- listVew(), setListViews(), addListView()
Definition at line 145 of file k3listviewsearchline.cpp.
QList< int > K3ListViewSearchLine::searchColumns | ( | ) | const |
Returns the current list of columns that will be searched.
If the returned list is empty all visible columns will be searched.
- See also
- setSearchColumns
Definition at line 102 of file k3listviewsearchline.cpp.
|
slot |
Make the search case sensitive or case insensitive.
- See also
- caseSenstive()
Definition at line 210 of file k3listviewsearchline.cpp.
|
slot |
When a search is active on a list that's organized into a tree view if a parent or ancesestor of an item is does not match the search then it will be hidden and as such so too will any children that match.
If this is set to true (the default) then the parents of matching items will be shown.
- See also
- keepParentsVisible
Definition at line 215 of file k3listviewsearchline.cpp.
|
slot |
Sets the K3ListView that is filtered by this search line, replacing any previously filtered listviews.
If lv is null then the widget will be disabled.
- See also
- listView(), setListViews()
Definition at line 226 of file k3listviewsearchline.cpp.
|
slot |
Sets K3ListViews that are filtered by this search line, replacing any previously filtered listviews.
If lvs is empty then the widget will be disabled.
- See also
- listViews(), addListView(), setListView()
Definition at line 232 of file k3listviewsearchline.cpp.
|
slot |
Sets the list of columns to be searched.
The default is to search all, visible columns which can be restored by passing columns as an empty list. If listviews to be filtered have different numbers or labels of columns this method has no effect.
- See also
- searchColumns
Definition at line 220 of file k3listviewsearchline.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 161 of file k3listviewsearchline.cpp.
|
protectedvirtual |
Updates search to only make visible appropriate items in listView.
If listView is null then nothing is done.
Definition at line 170 of file k3listviewsearchline.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.