From 81a4437dbc9788f8d22fde257edfcda2c5bb4837 Mon Sep 17 00:00:00 2001 From: rnv Date: Wed, 2 Aug 2017 11:32:06 +0300 Subject: [PATCH] Porting to Qt-5.9.0, PyQt-5.9.0, sip-4.19.3 --- .../SALOME_PYQT_PyModule.cxx | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx index e6ba25f84..b25bd2c41 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx @@ -1865,7 +1865,12 @@ void PyModuleHelper::setWorkSpace() } #if SIP_VERSION < 0x040800 PyObjWrapper pyws( sipBuildResult( 0, "M", aWorkspace, sipClass_QWidget) ); -#else +#else + #if SIP_VERSION >= 0x041303 + static const sipTypeDef *sipType_QWidget = 0; + if (!sipType_QWidget) + sipType_QWidget = sipFindType("QWidget"); + #endif PyObjWrapper pyws( sipBuildResult( 0, "D", aWorkspace, sipType_QWidget , NULL) ); #endif // ... and finally call Python module's setWorkSpace() method (obsolete) @@ -2281,6 +2286,11 @@ void PyModuleHelper::internalSelectionUpdated(const QStringList& entries) #if SIP_VERSION < 0x040800 PyObjWrapper sipList(sipBuildResult(0, "M", theList, sipClass_QStringList)); #else + #if SIP_VERSION >= 0x041303 + static const sipTypeDef *sipType_QStringList = 0; + if (!sipType_QStringList) + sipType_QStringList = sipFindType("QStringList"); + #endif PyObjWrapper sipList( sipBuildResult( 0, "D", theList, sipType_QStringList, NULL ) ); #endif if (PyObject_HasAttrString(myPyModule, (char*) "onSelectionUpdated")) @@ -2354,6 +2364,11 @@ void PyModuleHelper::internalContextMenu( const QString& context, QMenu* menu ) #if SIP_VERSION < 0x040800 PyObjWrapper sipPopup( sipBuildResult( 0, "M", menu, sipClass_QMenu ) ); #else + #if SIP_VERSION >= 0x041303 + static const sipTypeDef *sipType_QMenu = 0; + if (!sipType_QMenu) + sipType_QMenu = sipFindType("QMenu"); + #endif PyObjWrapper sipPopup( sipBuildResult( 0, "D", menu, sipType_QMenu, NULL ) ); #endif @@ -2574,6 +2589,11 @@ void PyModuleHelper::internalLoad( const QStringList& files, const QString& url, #if SIP_VERSION < 0x040800 PyObjWrapper sipList( sipBuildResult( 0, "M", theList, sipClass_QStringList ) ); #else + #if SIP_VERSION >= 0x041303 + static const sipTypeDef *sipType_QStringList = 0; + if (!sipType_QStringList) + sipType_QStringList = sipFindType("QStringList"); + #endif PyObjWrapper sipList( sipBuildResult( 0, "D", theList, sipType_QStringList, NULL ) ); #endif if ( PyObject_HasAttrString(myPyModule , (char*)"openFiles") ) { @@ -2737,6 +2757,11 @@ void PyModuleHelper::internalDropObjects( const DataObjectList& what, SUIT_DataO #if SIP_VERSION < 0x040800 PyObjWrapper sipList( sipBuildResult( 0, "M", theList, sipClass_QStringList) ); #else + #if SIP_VERSION >= 0x041303 + static const sipTypeDef *sipType_QStringList = 0; + if (!sipType_QStringList) + sipType_QStringList = sipFindType("QStringList"); + #endif PyObjWrapper sipList( sipBuildResult( 0, "D", theList, sipType_QStringList, NULL) ); #endif if ( PyObject_HasAttrString(myPyModule, (char*)"dropObjects") ) { -- 2.39.2