void PyModuleHelper::selectionUpdated(const QStringList& entries)
{
FuncMsg fmsg( "PyModuleHelper::selectionUpdated()" );
+ MESSAGE("selectionUpdated");
// perform synchronous request to Python event dispatcher
class SelectionReq : public PyInterp_LockRequest
: PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
myHelper( _helper ),
myEntries( _entries )
- {}
+ {
+ MESSAGE("SelectionReq");
+ }
protected:
virtual void execute()
{
+ MESSAGE("execute");
myHelper->internalSelectionUpdated( myEntries );
}
private:
const QStringList& myEntries;
};
- // get sender action
- QAction* action = qobject_cast<QAction*>( sender() );
- if ( !action )
- return;
-
// post request
PyInterp_Dispatcher::Get()->Exec( new SelectionReq( myInterp, this, entries ) );
}
}
#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)
void PyModuleHelper::internalSelectionUpdated(const QStringList& entries)
{
FuncMsg fmsg("--- PyModuleHelper::internalSelectionUpdated()");
+ MESSAGE("internalSelectionUpdated");
// Python interpreter should be initialized and Python module should be imported first
if (!myInterp || !myPyModule)
#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"))
{
+ MESSAGE("call onSelectionUpdated");
PyObjWrapper res(PyObject_CallMethod(myPyModule, (char*) "onSelectionUpdated", (char*) "O", sipList.get()));
if (!res)
#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
#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") ) {
#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") ) {