Partially revert "Remove unused code into GUI"

This commit is contained in:
wmayer
2022-07-17 11:54:55 +02:00
parent 7886d3cbf4
commit 07ccb73fe7
13 changed files with 164 additions and 8 deletions

View File

@@ -363,6 +363,11 @@ QObject* PythonWrapper::toQObject(const Py::Object& pyobject)
return reinterpret_cast<QObject*>(ptr);
#endif
#ifdef HAVE_PYQT // Unwrapping using sip/PyQt
void* ptr = qt_getCppPointer(pyobject, "sip", "unwrapinstance");
return reinterpret_cast<QObject*>(ptr);
#endif
return nullptr;
}
@@ -494,6 +499,10 @@ Py::Object PythonWrapper::fromQObject(QObject* object, const char* className)
//
return qt_wrapInstance<QObject*>(object, className, "shiboken2", "PySide2.QtCore", "wrapInstance");
#endif
#ifdef HAVE_PYQT // Unwrapping using sip/PyQt
Q_UNUSED(className);
return qt_wrapInstance<QObject*>(object, "QObject", "sip", "PyQt5.QtCore", "wrapinstance");
#endif
}
Py::Object PythonWrapper::fromQWidget(QWidget* widget, const char* className)
@@ -519,6 +528,11 @@ Py::Object PythonWrapper::fromQWidget(QWidget* widget, const char* className)
//
return qt_wrapInstance<QWidget*>(widget, className, "shiboken2", "PySide2.QtWidgets", "wrapInstance");
#endif
#ifdef HAVE_PYQT // Unwrapping using sip/PyQt
Q_UNUSED(className);
return qt_wrapInstance<QWidget*>(widget, "QWidget", "sip", "PyQt5.QtWidgets", "wrapinstance");
#endif
}
const char* PythonWrapper::getWrapperName(QObject* obj) const