Skip to content

fontlabapp.qt.safe · declarations 001

Back to fontlabapp.qt.safe

MAIN_WINDOW_CLASS module-attribute

MAIN_WINDOW_CLASS

main_window

main_window(fontlab: Any, qt: Any) -> Any

Return FontLab's main window; GUI thread only.

Prefer fontlab.MainWindow(). If the module lacks it or it returns None, scan QApplication.topLevelWidgets() through qt_list for the first widget whose className() is MainWindow. fontlab is the FontLab module and qt is the PythonQt module. Raise MainWindowNotFound if no window exists. The result is not cached; callers may cache it.

qt_list

qt_list(call: Callable[..., Any], *args: Any) -> list[Any]

Convert a native widget list with cyclic GC off (GUI thread only).

Run list(call(*args)) with the collector off through the native call and the iteration. Restore the caller's GC state even if the call or the conversion raises or toggles GC. Raise RuntimeError off the main thread before the native call starts and before GC state changes.