From 0c3fad73869469da6bf0ef5e94a2a06a616d8f47 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Sun, 23 Aug 2020 15:28:43 +0200 Subject: [PATCH] Add unused add_button method --- qt/aqt/models.py | 6 ++++++ 1 file changed, 6 insertions(+) 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"])