Gui: Fix comparison of argument of clicked() with StandardButton

Fixes #14639: Comparison between integers and StandardButton fails for Python task dialogs with PySide6
This commit is contained in:
wmayer
2024-06-13 15:44:18 +02:00
committed by Chris Hennes
parent 17eac1ab69
commit 594c382e5e
3 changed files with 23 additions and 1 deletions

View File

@@ -641,8 +641,9 @@ void TaskDialogPython::clicked(int i)
try {
if (dlg.hasAttr(std::string("clicked"))) {
Py::Callable method(dlg.getAttr(std::string("clicked")));
PythonWrapper wrap;
Py::Tuple args(1);
args.setItem(0, Py::Int(i));
args.setItem(0, wrap.toStandardButton(i));
method.apply(args);
}
}