Skip to content

fontlabapp.qt.dialogs

dialogs

Injected Qt dialog construction, execution and retained-box ownership.

What it does: Builds, runs and deletes Qt dialogs that the caller owns. Modal and file choosers: run_owned_dialog, run_message_box, run_file_dialog, run_text_dialog, run_button_message_box. run_standard_message_box preserves static warning/question title/text/buttons with owned priority. Modeless boxes: create_message_box, then show_message_box, later release_closed_message_boxes or close_message_boxes. name_filters builds the Qt file-filter list.

How to use: Pass PythonQt.QtGui as gui and parent widgets as parent_args (positional: PythonQt constructors reject keywords). Callers keep the callback, answer, icon-style and foreign-window policy.

Why this design: Modal and file execution delete the owned dialog in finally, so a failure in setup, exec() or the result read leaks no native dialog. The module imports no host and connects no signal, so it loads in a cold FontLab start and in tests without Qt.

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
close_message_boxes function (boxes: list[Any]) -> None Close and delete every retained box, newest first; empty <code>boxes</code>.
create_message_box function (gui: Any, text: Any, informative: Any, icon: str, parent_args: tuple[Any, ...]=(), *, detail: Any='') -> Any Prepare a caller-owned QMessageBox; do not show it.
name_filters function (filetypes: Sequence[str] | None) -> list[str] Build the Qt name-filter list for a file chooser.
release_closed_message_boxes function (boxes: list[Any]) -> None Delete the boxes that the user closed (hidden); keep the visible ones.
run_button_message_box function (box: Any, buttons: list[Any], accessory: Any=None) -> int | None Borrow widgets for one modal box and return the clicked input index.
run_file_dialog function (gui: Any, configure: Callable[[Any, Any], object], caption: Any, directory: Any, parent_args: tuple[Any, ...… Run one owned <code>QFileDialog</code>; return the selected paths or None.
run_message_box function (box: Any, buttons: Any) -> int Show <code>box</code><code> modally with standard </code><code>buttons</code><code>; return </code><code>exec()</code>'s result.
run_owned_dialog function (dialog: Any, configure: Callable[[Any], object], read_result: Callable[[Any, Any], Any]) -> Any Configure and execute one owned dialog, read its result, then delete it.
run_standard_message_box function (qt: Any, parent: Any, title: Any, text: Any, icon: str, buttons: Any, default_button: Any=None) -> Any Run an owned priority message with Qt's static standard-button result.
run_text_dialog function (gui: Any, message: Any, value: Any, title: Any, ok_button: Any=None, parent_args: tuple[Any, ...]=()) -> str… Run one owned <code>QInputDialog</code> text prompt; return the text or None.
show_message_box function (box: Any, boxes: list[Any], configure: Callable[[Any], object] | None=None) -> None Show <code>box</code><code> modeless and keep it in the caller&#x27;s </code><code>boxes</code> list.