# class KListWidgetSearchLine

###

Module | kdeui
Namespace |
Class | KListWidgetSearchLine
Inherits | KLineEdit

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.

### methods

- KListWidgetSearchLine (parent, listWidget)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QWidget | 0
  listWidget | QListWidget | 0

  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().

- KListWidgetSearchLine (a0, a1)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QWidget | 0
  a1 | QListWidget | 0

- caseSensitive ( )

  returns Qt.CaseSensitivity

  Returns if the search is case sensitive. This defaults to Qt.CaseInsensitive.

  See also setCaseSensitive()

- clear ( )

  returns Nothing

  Clear line edit and empty hiddenItems, returning elements to listWidget.

- event (event)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  event | QEvent |

  Re-implemented for internal reasons. API not affected.

- itemMatches (item, s)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  item | QListWidgetItem |
  s | QString |

  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.

- listWidget ( )

  returns QListWidget

  Returns the listWidget that is currently filtered by the search.

  See also setListWidget()

- setCaseSensitivity (cs)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  cs | Qt.CaseSensitivity |

  Make the search case sensitive or case insensitive.

  See also caseSenstive()

- setListWidget (lv)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  lv | QListWidget |

  Sets the QListWidget that is filtered by this search line. If lv is null then the widget will be disabled.

  See also listWidget()

- updateSearch (s)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  s | QString | QString()

  Updates search to only make visible the items that match s. If s is null then the line edit's text will be used.