# eric7.UI.SearchWidget

Module implementing the search box for the shell and log viewer.

### Global Attributes

None

### Classes

SearchWidget | Class implementing the search box for the shell and log viewer.

### Functions

None

## SearchWidget

Class implementing the search box for the shell and log viewer.

### Signals

searchNext(text, caseSensitive, wholeWord, regexp)
  emitted when the user pressed the next button (string, boolean, boolean)
searchPrevious(text, caseSensitive, wholeWord, regexp)
  emitted when the user pressed the previous button (string, boolean, boolean)

### Derived from

QWidget

### Class Attributes

None

### Class Methods

None

### Methods

SearchWidget | Constructor
__findByReturnPressed | Private slot to handle the returnPressed signal of the findtext combobox.
__setSearchButtons | Private slot to set the state of the search buttons.
keyPressEvent | Protected slot to handle key press events.
on_closeButton_clicked | Private slot to close the widget.
on_findNextButton_clicked | Private slot to find the next occurrence.
on_findPrevButton_clicked | Private slot to find the previous occurrence.
on_findtextCombo_editTextChanged | Private slot to enable/disable the find buttons.
searchStringFound | Public slot to indicate that the search string was found.
showFind | Public method to display this widget.

### Static Methods

None

#### SearchWidget (Constructor)

SearchWidget(mainWindow, parent=None, spacer=True, showLine=False)

Constructor

mainWindow (QWidget)
  reference to the main window
parent (QWidget)
  reference to the parent widget
spacer (bool)
  flag indicating to add a vertical spacer to the main layout
showLine (bool)
  flag indicating to show all widget in one row

#### SearchWidget.__findByReturnPressed

__findByReturnPressed()

Private slot to handle the returnPressed signal of the findtext combobox.

#### SearchWidget.__setSearchButtons

__setSearchButtons(enabled)

Private slot to set the state of the search buttons.

enabled
  flag indicating the state (boolean)

#### SearchWidget.keyPressEvent

keyPressEvent(event)

Protected slot to handle key press events.

event
  reference to the key press event (QKeyEvent)

#### SearchWidget.on_closeButton_clicked

on_closeButton_clicked()

Private slot to close the widget.

#### SearchWidget.on_findNextButton_clicked

on_findNextButton_clicked()

Private slot to find the next occurrence.

#### SearchWidget.on_findPrevButton_clicked

on_findPrevButton_clicked()

Private slot to find the previous occurrence.

#### SearchWidget.on_findtextCombo_editTextChanged

on_findtextCombo_editTextChanged(txt)

Private slot to enable/disable the find buttons.

txt
  text of the combobox (string)

#### SearchWidget.searchStringFound

searchStringFound(found)

Public slot to indicate that the search string was found.

found
  flag indicating success (boolean)

#### SearchWidget.showFind

showFind(txt="")

Public method to display this widget.

txt
  text to be shown in the combo (string)

Up