Skip to content

Commit

Permalink
Materials: Fix QT6 error
Browse files Browse the repository at this point in the history
The MaterialTreeWidget was not working in QT6 due to a type check for a
QT5 widget
  • Loading branch information
davesrocketshop authored and chennes committed Sep 25, 2024
1 parent ca7b7fe commit 9df2ec7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Mod/Material/Gui/MaterialTreeWidgetPyImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ int MaterialTreeWidgetPy::PyInit(PyObject* args, PyObject* /*kwd*/)

PyErr_Clear();
if (PyArg_ParseTuple(args, "O", &obj)) {
if (QLatin1String(obj->ob_type->tp_name) == QLatin1String("PySide2.QtWidgets.QWidget")) {
if ((QLatin1String(obj->ob_type->tp_name) == QLatin1String("PySide2.QtWidgets.QWidget")) ||
(QLatin1String(obj->ob_type->tp_name) == QLatin1String("PySide6.QtWidgets.QWidget"))) {
Gui::PythonWrapper wrap;
wrap.loadWidgetsModule();
auto qObject = wrap.toQObject(Py::Object(obj));
Expand Down

0 comments on commit 9df2ec7

Please sign in to comment.