Partially revert "Remove unused code into GUI"
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user