compile_ui_file

compile_ui_file(ui_file: str | Path, output_path: str | Path, *, generator: Literal['python', 'cpp'] = 'python', form_import: bool = True, uic_args: Sequence[str] = ()) Path[source]

Call ‘Qt User Interface Compiler’ to create code from a ui file.

Parameters:
  • ui_file (str | Path) – Path to the ui file.

  • output_path (str | Path) – Path the output file should be saved to.

  • generator (Literal["python", "cpp"]) – Language to generate code for. Defaults to “python”

  • form_import (bool) – Sets the ‘–from-imports’ flag when used with python. Defaults to True

  • uic_args (Sequence[str]) – Additional args for ‘uic’ (use ‘–help’ for details). Defaults to ()

Returns:

Path of the compiled file

Return type:

Path