# eric6.Project.ProjectFormsBrowser

Module implementing a class used to display the forms part of the project.

### Global Attributes

None

### Classes

ProjectFormsBrowser | A class used to display the forms part of the project.

### Functions

None

## ProjectFormsBrowser

A class used to display the forms part of the project.

### Signals

appendStderr(str)
  emitted after something was received from a QProcess on stderr
menusAboutToBeCreated()
  emitted when the context menus are about to be created. This is the right moment to add or remove hook methods.
showMenu(str, QMenu)
  emitted when a menu is about to be shown. The name of the menu and a reference to the menu are given.
uipreview(str)
  emitted to preview a forms file

### Derived from

ProjectBaseBrowser

### Class Attributes

PyuicIndentDefault

### Class Methods

None

### Methods

ProjectFormsBrowser | Constructor
__TRPreview | Private slot to handle the Preview translations action.
__UIPreview | Private slot to handle the Preview menu action.
__addFormFiles | Private method to add form files to the project.
__addFormsDirectory | Private method to add form files of a directory to the project.
__compileAllForms | Private method to compile all forms to source files.
__compileForm | Private method to compile a form to a source file.
__compileSelectedForms | Private method to compile selected forms to source files.
__compileUI | Private method to compile a .ui file to a .py/.rb file.
__compileUIDone | Private slot to handle the finished signal of the pyuic/rbuic process.
__configureUicCompiler | Private slot to configure some non-common uic compiler options.
__deleteFile | Private method to delete a form file from the project.
__determineUiCompiler | Private method to determine the UI compiler for the project.
__generateDialogCode | Private method to generate dialog code for the form (Qt4 only).
__newForm | Private slot to handle the New Form menu action.
__newUiForm | Private slot to handle the New Form menu action for Qt-related projects.
__openFile | Private slot to handle the Open menu action.
__openFileInEditor | Private slot to handle the Open in Editor menu action.
__readStderr | Private slot to handle the readyReadStandardError signal of the pyuic4/pyuic5/pyside-uic/pyside2-uic/rbuic4 process.
__readStdout | Private slot to handle the readyReadStandardOutput signal of the pyuic4/pyuic5/pyside-uic/pyside2-uic/rbuic4 process.
__resetUiCompiler | Private slot to reset the determined UI compiler executable.
__showContextMenu | Private slot called by the menu aboutToShow signal.
__showContextMenuBack | Private slot called by the backMenu aboutToShow signal.
__showContextMenuDir | Private slot called by the dirMenu aboutToShow signal.
__showContextMenuDirMulti | Private slot called by the dirMultiMenu aboutToShow signal.
__showContextMenuMulti | Private slot called by the multiMenu aboutToShow signal.
_contextMenuRequested | Protected slot to show the context menu.
_createPopupMenus | Protected overloaded method to generate the popup menu.
_initHookMethods | Protected method to initialize the hooks dictionary.
_openItem | Protected slot to handle the open popup menu entry.
compileChangedForms | Public method to compile all changed forms to source files.
getUiCompiler | Public method to get the UI compiler executable of the project.
handlePreferencesChanged | Public slot used to handle the preferencesChanged signal.

### Static Methods

None

#### ProjectFormsBrowser (Constructor)

ProjectFormsBrowser(project, parent=None)

Constructor

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

#### ProjectFormsBrowser.__TRPreview

__TRPreview()

Private slot to handle the Preview translations action.

#### ProjectFormsBrowser.__UIPreview

__UIPreview()

Private slot to handle the Preview menu action.

#### ProjectFormsBrowser.__addFormFiles

__addFormFiles()

Private method to add form files to the project.

#### ProjectFormsBrowser.__addFormsDirectory

__addFormsDirectory()

Private method to add form files of a directory to the project.

#### ProjectFormsBrowser.__compileAllForms

__compileAllForms()

Private method to compile all forms to source files.

#### ProjectFormsBrowser.__compileForm

__compileForm()

Private method to compile a form to a source file.

#### ProjectFormsBrowser.__compileSelectedForms

__compileSelectedForms()

Private method to compile selected forms to source files.

#### ProjectFormsBrowser.__compileUI

__compileUI(fn, noDialog=False, progress=None)

Private method to compile a .ui file to a .py/.rb file.

fn
  filename of the .ui file to be compiled
noDialog
  flag indicating silent operations
progress
  reference to the progress dialog

Returns:
  reference to the compile process (QProcess)

#### ProjectFormsBrowser.__compileUIDone

__compileUIDone(exitCode, exitStatus)

Private slot to handle the finished signal of the pyuic/rbuic process.

exitCode
  exit code of the process (integer)
exitStatus
  exit status of the process (QProcess.ExitStatus)

#### ProjectFormsBrowser.__configureUicCompiler

__configureUicCompiler()

Private slot to configure some non-common uic compiler options.

#### ProjectFormsBrowser.__deleteFile

__deleteFile()

Private method to delete a form file from the project.

#### ProjectFormsBrowser.__determineUiCompiler

__determineUiCompiler()

Private method to determine the UI compiler for the project.

#### ProjectFormsBrowser.__generateDialogCode

__generateDialogCode()

Private method to generate dialog code for the form (Qt4 only).

#### ProjectFormsBrowser.__newForm

__newForm()

Private slot to handle the New Form menu action.

#### ProjectFormsBrowser.__newUiForm

__newUiForm(path)

Private slot to handle the New Form menu action for Qt-related projects.

path
  full directory path for the new form file (string)

#### ProjectFormsBrowser.__openFile

__openFile()

Private slot to handle the Open menu action.

#### ProjectFormsBrowser.__openFileInEditor

__openFileInEditor()

Private slot to handle the Open in Editor menu action.

#### ProjectFormsBrowser.__readStderr

__readStderr()

Private slot to handle the readyReadStandardError signal of the pyuic4/pyuic5/pyside-uic/pyside2-uic/rbuic4 process.

#### ProjectFormsBrowser.__readStdout

__readStdout()

Private slot to handle the readyReadStandardOutput signal of the pyuic4/pyuic5/pyside-uic/pyside2-uic/rbuic4 process.

#### ProjectFormsBrowser.__resetUiCompiler

__resetUiCompiler()

Private slot to reset the determined UI compiler executable.

#### ProjectFormsBrowser.__showContextMenu

__showContextMenu()

Private slot called by the menu aboutToShow signal.

#### ProjectFormsBrowser.__showContextMenuBack

__showContextMenuBack()

Private slot called by the backMenu aboutToShow signal.

#### ProjectFormsBrowser.__showContextMenuDir

__showContextMenuDir()

Private slot called by the dirMenu aboutToShow signal.

#### ProjectFormsBrowser.__showContextMenuDirMulti

__showContextMenuDirMulti()

Private slot called by the dirMultiMenu aboutToShow signal.

#### ProjectFormsBrowser.__showContextMenuMulti

__showContextMenuMulti()

Private slot called by the multiMenu aboutToShow signal.

#### ProjectFormsBrowser._contextMenuRequested

_contextMenuRequested(coord)

Protected slot to show the context menu.

coord
  the position of the mouse pointer (QPoint)

#### ProjectFormsBrowser._createPopupMenus

_createPopupMenus()

Protected overloaded method to generate the popup menu.

#### ProjectFormsBrowser._initHookMethods

_initHookMethods()

Protected method to initialize the hooks dictionary.

Supported hook methods are:

- compileForm: takes filename as parameter
- compileAllForms: takes list of filenames as parameter
- compileSelectedForms: takes list of filenames as parameter
- compileChangedForms: takes list of filenames as parameter
- generateDialogCode: takes filename as parameter
- newForm: takes full directory path of new file as parameter
- open: takes a filename as parameter

Note: Filenames are relative to the project directory, if not specified differently.

#### ProjectFormsBrowser._openItem

_openItem()

Protected slot to handle the open popup menu entry.

#### ProjectFormsBrowser.compileChangedForms

compileChangedForms()

Public method to compile all changed forms to source files.

#### ProjectFormsBrowser.getUiCompiler

getUiCompiler()

Public method to get the UI compiler executable of the project.

Returns:
  UI compiler executable

Return Type:
  str

#### ProjectFormsBrowser.handlePreferencesChanged

handlePreferencesChanged()

Public slot used to handle the preferencesChanged signal.

Up