]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
PAL11834
authorvsr <vsr@opencascade.com>
Mon, 13 Mar 2006 06:47:01 +0000 (06:47 +0000)
committervsr <vsr@opencascade.com>
Mon, 13 Mar 2006 06:47:01 +0000 (06:47 +0000)
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx
src/SALOME_SWIG/SALOMEGUI_shared_modules.py

index 1f1a3a5e27bd626b8732bdac834df040a44ec89b..0593d778418e5cd72c75835bae53027ad769de80 100644 (file)
@@ -120,10 +120,16 @@ private:
 // While the SalomePyQtGUI library is not imported in Python it's initialization function
 // should be called manually (and only once) in order to initialize global sip data
 // and to get C API from sip : sipBuildResult for example
+#if defined(SIP_VERS_v4_old) || defined(SIP_VERS_v4_new)
+#define INIT_FUNCTION initSalomePyQtGUI
 #if defined(SIP_STATIC_MODULE)
-extern "C" void initSalomePyQtGUI();
+extern "C" void INIT_FUNCTION();
+#else
+PyMODINIT_FUNC INIT_FUNCTION();
+#endif
 #else
-PyMODINIT_FUNC initSalomePyQtGUI();
+#define INIT_FUNCTION initlibSalomePyQtGUIc
+extern "C" void INIT_FUNCTION();
 #endif
 
 /*!
@@ -136,7 +142,7 @@ extern "C" {
     if ( !alreadyInitialized ) {
       // call only once (see above) !
       PyEval_RestoreThread( KERNEL_PYTHON::_gtstate );
-      initSalomePyQtGUI();
+      INIT_FUNCTION();
       PyEval_ReleaseThread( KERNEL_PYTHON::_gtstate );
       alreadyInitialized = !alreadyInitialized;
     }
index 086d5e7fefb2a49b1d4312ac1f17b04d63cc744c..cd849085d987c4202b5c5853c72b164aca78acc9 100755 (executable)
@@ -4,6 +4,9 @@
 
 import SALOME_Session_idl
 
+from import_hook import register_name
+register_name("SalomePyQt")
+   
 # this function is required
 
 def init_shared_modules():