UI Design¶
REvoDesign uses Qt Designer for visual UI layout. The main UI definition is
src/REvoDesign/UI/REvoDesign.ui — an XML file created and edited in Qt
Designer. There is also REvoDesign-PyMOL-entry.ui for the standalone Package
Manager installer window.
Workflow¶
Editing the UI¶
-
Open
REvoDesign.uiin Qt Designer — Use Qt 5 Designer (matching the PyQt5 runtime). The VS Code "PYQT Integration" extension can also be used. -
Modify the layout — Add/remove widgets, adjust layouts, set object names. Object names are critical: they become Python attribute names on the
RuntimeUiProxyand are referenced throughout the codebase. -
Save — The
.uifile is the source of truth. Do not manually edit the generated typing contract.
After UI Changes¶
-
Regenerate the typing contract:
This updatespython dev/tools/generate_ui_typing.pysrc/REvoDesign/UI/types.pywith typed attributes for IDE autocompletion. The pre-commit hookgenerate-ui-typingruns this automatically. -
Update translations — See Translation for updating
.ts/.qmfiles. -
Verify — The pre-commit hook
validate-ui-i18nsmoke-tests runtime loading and the i18n pipeline:python dev/tools/generate_ui_typing.py --check
Key Files¶
| File | Purpose |
|---|---|
UI/REvoDesign.ui |
Main plugin window layout (tabs, buttons, tables, menus) |
UI/REvoDesign-PyMOL-entry.ui |
Package Manager installer window |
UI/types.py |
Auto-generated REvoDesignUiProtocol typing contract |
UI/language/ |
Translation .ts/.qm files and language.json registry |
UI/liguist.pro |
Qt Linguist project file for translation pipeline |
Runtime Loading¶
The .ui file is loaded at runtime (no code generation step) by
RuntimeUiProxy in REvoDesign.Qt.ui_runtime_loader:
from REvoDesign.Qt.ui_runtime_loader import load_runtime_ui
main_window, ui = load_runtime_ui(ui_path)
This avoids the deprecated Ui_REvoDesign.py pattern. The
reject-generated-main-ui pre-commit hook prevents that file from being
re-introduced.
Object Naming Conventions¶
Widget object names in Qt Designer follow these patterns:
- Descriptive prefixes:
pushButton_,comboBox_,checkBox_,radioButton_,spinBox_,doubleSpinBox_,tabWidget_,label_,groupBox_,tableWidget_,textEdit_. - Config-mapped widgets: Names match config item keys for automatic
binding via
Widget2ConfigMapper(see Architecture). - Menu actions: Named
actionSomething_Descriptive— these becomeQActionattributes on the proxy. - Duplicate names: If the
.uifile has duplicate object names,RuntimeUiProxyrecords them in_duplicate_object_namesand only the first-seen object becomes an attribute on the proxy. Avoid duplicates.
Adding a New Widget¶
- Add the widget in Qt Designer with a unique, descriptive
objectName. - If the widget maps to a config value, add an entry in
driver/widget_link.py(Config2WidgetIdsorPushButtons). - If the widget needs signal wiring, add the connection in
REvoDesignPlugin.__init__()or a deferredQTimercallback. - Regenerate
types.pyand update translations. - If it's a new menu action, add a
MenuItemregistration inREvoDesignPlugin._bind_menu_links().
Package Manager UI¶
The Package Manager uses a separate .ui file
(REvoDesign-PyMOL-entry.ui) and has its own bootstrap path:
REvoDesignPackageManager.__init__()
→ load_runtime_ui("REvoDesign-PyMOL-entry.ui")
→ populate extras table from Gist JSON
→ wire Git solver, pip installer, and thread dashboard
The Package Manager .ui is uploaded to GitHub Gist via make upload-gists
for distribution. It currently has no translations.