# eric6.Project.QuickFindFileDialog

Module implementing a quick search for files.

This is basically the FindFileNameDialog modified to support faster interactions.

### Global Attributes

None

### Classes

QuickFindFileDialog | Class implementing the Quick Find File by Name Dialog.

### Functions

None

## QuickFindFileDialog

Class implementing the Quick Find File by Name Dialog.

This dialog provides a slightly more streamlined behaviour than the standard FindFileNameDialog in that it tries to match any name in the project against (fragmentary) bits of file names.

### Signals

designerFile(str)
  emitted to open a Qt-Designer file
linguistFile(str)
  emitted to open a Qt translation file
sourceFile(str)
  emitted to open a file in the editor

### Derived from

QWidget, Ui_QuickFindFile

### Class Attributes

None

### Class Methods

None

### Methods

QuickFindFileDialog | Constructor
__generateLocations | Private method to generate a set of locations that can be searched.
__openFile | Private slot to open a file.
__searchFile | Private slot to handle the search.
__sortedMatches | Private method to find the subset of items which match a search term.
eventFilter | Public method to handle event for another object.
on_buttonBox_clicked | Private slot called by a button of the button box clicked.
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_fileNameEdit_returnPressed | Private slot to handle enter being pressed on the file name edit box.
on_fileNameEdit_textChanged | Private slot to handle the textChanged signal of the file name edit.
show | Public method to enable/disable the project checkbox.

### Static Methods

None

#### QuickFindFileDialog (Constructor)

QuickFindFileDialog(project, parent=None)

Constructor

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

#### QuickFindFileDialog.__generateLocations

__generateLocations()

Private method to generate a set of locations that can be searched.

Returns:
  yields set of files in our project...

Return Type:
  str

#### QuickFindFileDialog.__openFile

__openFile(itm=None)

Private slot to open a file.

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

itm (QTreeWidgetItem)
  item to be opened

Returns:
  flag indicating a file was opened

Return Type:
  bool

#### QuickFindFileDialog.__searchFile

__searchFile()

Private slot to handle the search.

#### QuickFindFileDialog.__sortedMatches

__sortedMatches(items, searchTerm)

Private method to find the subset of items which match a search term.

items (list of str)
  list of items to be scanned for the search term
searchTerm (str)
  search term to be searched for

Returns:
  sorted subset of items which match searchTerm in relevance order (i.e. the most likely match first)

Return Type:
  list of tuple of bool, int and str

#### QuickFindFileDialog.eventFilter

eventFilter(source, event)

Public method to handle event for another object.

source (QObject)
  object to handle events for
event (QEvent)
  event to handle

Returns:
  flag indicating that the event was handled

Return Type:
  bool

#### QuickFindFileDialog.on_buttonBox_clicked

on_buttonBox_clicked(button)

Private slot called by a button of the button box clicked.

button
  button that was clicked (QAbstractButton)

#### QuickFindFileDialog.on_fileList_currentItemChanged

on_fileList_currentItemChanged(current, previous)

Private slot handling a change of the current item.

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

#### QuickFindFileDialog.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
  the double clicked listview item (QTreeWidgetItem)
column
  column that was double clicked (integer) (ignored)

#### QuickFindFileDialog.on_fileNameEdit_returnPressed

on_fileNameEdit_returnPressed()

Private slot to handle enter being pressed on the file name edit box.

#### QuickFindFileDialog.on_fileNameEdit_textChanged

on_fileNameEdit_textChanged(text)

Private slot to handle the textChanged signal of the file name edit.

text
  (ignored)

#### QuickFindFileDialog.show

show()

Public method to enable/disable the project checkbox.

Up