eric7.Utilities.uic

Module implementing a function to compile all user interface files of a directory or directory tree.

Global Attributes

None

Classes

None

Functions

__compileUi Function to create a Python module from a Qt Designer .ui file.
__pyName Local function to create the Python source file name for the compiled .ui file.
compileOneUi Function to compile a single form file to Python code.
compileUiFiles Module function to compile the .ui files of a directory tree to Python sources.


__compileUi

__compileUi(uifile, pyfile, execute=False, indent=4, uiheadername="")

Function to create a Python module from a Qt Designer .ui file.

uifile (str or file)
file name or file-like object containing the .ui file
pyfile (file)
file-like object to which the Python code will be written to
execute (bool (optional))
flag indicating to generate extra Python code that allows the code to be run as a standalone application (defaults to False)
indent (int (optional))
indentation width using spaces. If it is 0 then a tab is used. (defaults to 4)
uiheadername (str ((optional))
UI file name to be placed in the header (defaults to "")
Up


__pyName

__pyName(py_dir, py_file)

Local function to create the Python source file name for the compiled .ui file.

py_dir (str)
suggested name of the directory
py_file (str)
suggested name for the compiled source file
Return:
tuple of directory name and source file name
Return Type:
tuple of (str, str)
Up


compileOneUi

compileOneUi(ui_path, mapFunc=None, execute=False, indent=4, uiheadername="")

Function to compile a single form file to Python code.

ui_path (str)
path of the Qt form file
mapFunc (func (optional))
function to change directory and/or name of the resulting Python file (defaults to None)
execute (bool (optional))
flag indicating to generate code to execute the form in standalone mode (defaults to False)
indent (int (optional))
indentation width using spaces (defaults to 4)
uiheadername (str ((optional))
UI file name to be placed in the header (defaults to "")
Up


compileUiFiles

compileUiFiles(directory, recurse=False)

Module function to compile the .ui files of a directory tree to Python sources.

directory (str)
name of a directory to scan for .ui files
recurse (boolean))
flag indicating to recurse into subdirectories
Up