Gui: Implement PythonWrapper::fromQAction

Wrapping QAction through QObject does not work as QAction class
is a part of QtGui not QtCore, so Py::Object with internal
pointer being null is returned causing a crash later.
Therefore implement fromQAction conversion method.
This commit is contained in:
Ladislav Michl
2024-02-24 02:21:30 +01:00
committed by wwmayer
parent fe70801fc2
commit 61bca92941
4 changed files with 28 additions and 3 deletions

View File

@@ -274,10 +274,10 @@ PyObject* CommandPy::getAction(PyObject *args)
if (group) {
const auto actions = group->actions();
for (auto a : actions)
list.append(wrap.fromQObject(a));
list.append(wrap.fromQAction(a));
}
else if (action) {
list.append(wrap.fromQObject(action->action()));
list.append(wrap.fromQAction(action->action()));
}
return Py::new_reference_to(list);