# eric7.UI.FindLocationWidget

Module implementing a dialog to search for files.

### Global Attributes

None

### Classes

FindLocationWidget | Class implementing a widget to search for files.

### Functions

None

## FindLocationWidget

Class implementing a widget to search for files.

The occurrences found are displayed in a QTreeWidget showing the filename and the pathname. The file will be opened upon a double click onto the respective entry of the list or by pressing the open button.

### Signals

designerFile(str)
  emitted to open a Qt-Designer file
linguistFile(str)
  emitted to open a Qt-Linguist (*.ts) file
pixmapFile(str)
  emitted to open a pixmap file
sourceFile(str)
  emitted to open a file in the editor
svgFile(str)
  emitted to open a SVG file
trpreview([str])
  emitted to preview Qt-Linguist (*.qm) files
umlFile(str)
  emitted to open an eric UML file

### Derived from

QWidget, Ui_FindLocationWidget

### Class Attributes

None

### Class Methods

None

### Methods

FindLocationWidget | Constructor
__clearResults | Private slot to clear the current search results.
__openFile | Private slot to open a file.
__projectClosed | Private slot to handle a project being closed.
__projectOpened | Private slot to handle a project being opened.
__searchFile | Private slot to handle the search.
__stopSearch | Private slot to handle the stop button being pressed.
activate | Public slot to enable/disable the project checkbox.
checkStop | Public method to check, if the search should be stopped.
on_fileList_currentItemChanged | Private slot handling a change of the current item.
on_fileList_itemActivated | Private slot to handle the double click on a file item.
on_searchDirPicker_textChanged | Private slot to handle the textChanged signal of the search directory edit.

### Static Methods

None

#### FindLocationWidget (Constructor)

FindLocationWidget(project, parent=None)

Constructor

project (Project)
  reference to the project object
parent (QWidget)
  parent widget of this dialog

#### FindLocationWidget.__clearResults

__clearResults()

Private slot to clear the current search results.

#### FindLocationWidget.__openFile

__openFile(itm=None)

Private slot to open a file.

It emits a signal depending on the file extension.

itm (QTreeWidgetItem)
  item to be opened

#### FindLocationWidget.__projectClosed

__projectClosed()

Private slot to handle a project being closed.

#### FindLocationWidget.__projectOpened

__projectOpened()

Private slot to handle a project being opened.

#### FindLocationWidget.__searchFile

__searchFile()

Private slot to handle the search.

#### FindLocationWidget.__stopSearch

__stopSearch()

Private slot to handle the stop button being pressed.

#### FindLocationWidget.activate

activate()

Public slot to enable/disable the project checkbox.

#### FindLocationWidget.checkStop

checkStop()

Public method to check, if the search should be stopped.

Return:
  flag indicating the search should be stopped

Return Type:
  bool

#### FindLocationWidget.on_fileList_currentItemChanged

on_fileList_currentItemChanged(current, previous)

Private slot handling a change of the current item.

current (QTreeWidgetItem)
  current item
previous (QTreeWidgetItem)
  prevoius current item

#### FindLocationWidget.on_fileList_itemActivated

on_fileList_itemActivated(itm, column)

Private slot to handle the double click on a file item.

It emits the signal sourceFile or designerFile depending on the file extension.

itm (QTreeWidgetItem)
  the double clicked listview item
column (int)
  column that was double clicked (ignored)

#### FindLocationWidget.on_searchDirPicker_textChanged

on_searchDirPicker_textChanged(text)

Private slot to handle the textChanged signal of the search directory edit.

text (str)
  text of the search dir edit

Up