diff --git a/qt/aqt/models.py b/qt/aqt/models.py index 13426a306..faf4fd71e 100644 --- a/qt/aqt/models.py +++ b/qt/aqt/models.py @@ -72,6 +72,12 @@ class Models(QDialog): f.modelsList.setCurrentRow(0) maybeHideClose(box) + def add_button(self, label: str, func: Callable[Any, None]) -> None: + box = self.form.buttonBox + + button = box.addButton(_(label), QDialogButtonBox.ActionRole) + qconnect(button.clicked, func) + def onRename(self) -> None: nt = self.current_notetype() txt = getText(_("New name:"), default=nt["name"])