]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
PySide: attempt number one. rnv/pyside_exprm
authorrnv <rnv@opencascade.com>
Tue, 29 Nov 2016 11:32:24 +0000 (14:32 +0300)
committerrnv <rnv@opencascade.com>
Tue, 29 Nov 2016 11:32:24 +0000 (14:32 +0300)
23 files changed:
CMakeLists.txt
SalomeGUIConfig.cmake.in
adm_local/cmake_files/CMakeLists.txt
adm_local/cmake_files/CommonTools.cmake [new file with mode: 0644]
adm_local/cmake_files/FindPyTools.cmake [new file with mode: 0644]
adm_local/cmake_files/FindSalomePyQt4.cmake
adm_local/cmake_files/FindSalomePySide.cmake [new file with mode: 0644]
adm_local/cmake_files/FindSalomeShiboken.cmake [new file with mode: 0644]
adm_local/cmake_files/UsePyQt4.cmake
adm_local/cmake_files/UsePySide.cmake [new file with mode: 0644]
src/GUI_PY/CMakeLists.txt
src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx
src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_GUILight_global.h [new file with mode: 0644]
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_GUILight_typesystem.xml [new file with mode: 0644]
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx
src/SALOME_PYQT/SalomePyQt/CMakeLists.txt
src/SALOME_PYQT/SalomePyQt/SalomePyQt.h
src/SALOME_PYQT/SalomePyQt/SalomePyQt_global.h [new file with mode: 0644]
src/SALOME_PYQT/SalomePyQt/SalomePyQt_typesystem.xml [new file with mode: 0644]
src/SalomeApp/salome_pluginsmanager.py

index 66873d4570a378f944f2f7f534c8df7aa1f06c47..837b7e2b77d9cce222289106b48d98aba5e4a49e 100755 (executable)
@@ -76,6 +76,7 @@ OPTION(SALOME_USE_QXGRAPHVIEWER "Enable QX graph visualization (Mandatory in cla
 CMAKE_DEPENDENT_OPTION(SALOME_USE_SALOMEOBJECT "Enable Salome Object (Mandatory in classic configurations)" ON
                        "SALOME_LIGHT_ONLY" ON)
 OPTION(SALOME_USE_SINGLE_DESKTOP "Enable multiple document interface" ON)
+OPTION(SALOME_USE_PYSIDE "Use PySide + Shiboken to wrap GUI funtionality in the python module, otherwise PyQt + SIP is used" ON)
 
 MARK_AS_ADVANCED(SALOME_LIGHT_ONLY SALOME_USE_VTKVIEWER SALOME_USE_GRAPHICSVIEW)
 MARK_AS_ADVANCED(SALOME_USE_SALOMEOBJECT SALOME_USE_OCCVIEWER SALOME_USE_GLVIEWER SALOME_USE_PLOT2DVIEWER)
@@ -123,8 +124,11 @@ ENDIF()
 ##
 ## GUI specifics
 ##
-
-FIND_PACKAGE(SalomeSIP REQUIRED)  # should come after Python and before PyQt4
+IF(SALOME_USE_PYSIDE)
+  FIND_PACKAGE(SalomeShiboken REQUIRED) # should come after Python and before PySide
+ELSE(SALOME_USE_PYSIDE)
+  FIND_PACKAGE(SalomeSIP REQUIRED) # should come after Python and before PyQt4
+ENDIF()
 
 # Build with GUI observers feature
 IF(SALOME_GUI_USE_OBSERVERS)
@@ -145,7 +149,11 @@ ENDIF()
 FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtWebKit QtOpenGL)
 INCLUDE(${QT_USE_FILE})
 
-FIND_PACKAGE(SalomePyQt4 REQUIRED)
+IF(SALOME_USE_PYSIDE)
+  FIND_PACKAGE(SalomePySide REQUIRED)
+ELSE(SALOME_USE_PYSIDE)
+  FIND_PACKAGE(SalomePyQt4 REQUIRED)
+ENDIF(SALOME_USE_PYSIDE)
 
 # Optional prerequisites for GUI
 IF(SALOME_USE_GLVIEWER)
@@ -352,9 +360,14 @@ EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets}
 
 #      Ensure the variables are always defined for the configure:
 SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}")
-SET(SIP_ROOT_DIR "${SIP_ROOT_DIR}")
+IF(SALOME_USE_PYSIDE)
+  SET(SHIBOKEN_ROOT_DIR "${SHIBOKEN_ROOT_DIR}")
+  SET(PYSIDE_ROOT_DIR "${PYSIDE_ROOT_DIR}")
+ELSE(SALOME_USE_PYSIDE)
+  SET(SIP_ROOT_DIR "${SIP_ROOT_DIR}")
+  SET(PYQT4_ROOT_DIR "${PYQT4_ROOT_DIR}")
+ENDIF(SALOME_USE_PYSIDE)
 SET(QT4_ROOT_DIR "${QT4_ROOT_DIR}")
-SET(PYQT4_ROOT_DIR "${PYQT4_ROOT_DIR}")
 SET(CAS_ROOT_DIR "${CAS_ROOT_DIR}")
 SET(OPENGL_ROOT_DIR "${OPENGL_ROOT_DIR}")
 SET(VTK_ROOT_DIR "${VTK_ROOT_DIR}")
@@ -363,14 +376,23 @@ SET(QWT_ROOT_DIR "${QWT_ROOT_DIR}")
 SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include")
 
 # Build variables that will be expanded when configuring Salome<MODULE>Config.cmake:
-SALOME_CONFIGURE_PREPARE(CAS OpenGL PyQt4 Qt4 Qwt SIP VTK)
-
-CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in 
-    ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
-    INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
-    PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
-       KERNEL_ROOT_DIR SIP_ROOT_DIR QT4_ROOT_DIR PYQT4_ROOT_DIR CAS_ROOT_DIR 
-       OPENGL_ROOT_DIR VTK_ROOT_DIR QWT_ROOT_DIR)
+IF(SALOME_USE_PYSIDE)
+  SALOME_CONFIGURE_PREPARE(CAS OpenGL PySide Qt4 Qwt Shiboken VTK)
+  CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in 
+      ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
+      INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
+      PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
+         KERNEL_ROOT_DIR SHIBOKEN_ROOT_DIR QT4_ROOT_DIR PYSIDE_ROOT_DIR CAS_ROOT_DIR 
+         OPENGL_ROOT_DIR VTK_ROOT_DIR QWT_ROOT_DIR)
+ELSE(SALOME_USE_PYSIDE)
+  SALOME_CONFIGURE_PREPARE(CAS OpenGL PyQt4 Qt4 Qwt SIP VTK)
+  CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in 
+      ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
+      INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
+      PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
+         KERNEL_ROOT_DIR SIP_ROOT_DIR QT4_ROOT_DIR PYQT4_ROOT_DIR CAS_ROOT_DIR 
+         OPENGL_ROOT_DIR VTK_ROOT_DIR QWT_ROOT_DIR)
+ENDIF(SALOME_USE_PYSIDE)
 
 #   - in the install tree (VSR 16/08/2013: TEMPORARILY COMMENT THIS - TO REMOVE?):
 #       Get the relative path of the include directory so 
index a2807ff0d041c5e96ec0f410df86d01da5a5ac38..f986faca70c5098a38514fe3d6a795154bdd4901 100644 (file)
@@ -61,6 +61,7 @@ SET(SALOME_USE_QXGRAPHVIEWER  @SALOME_USE_QXGRAPHVIEWER@)
 SET(SALOME_USE_PYCONSOLE      @SALOME_USE_PYCONSOLE@)
 SET(SALOME_USE_SALOMEOBJECT   @SALOME_USE_SALOMEOBJECT@)
 SET(SALOME_USE_SINGLE_DESKTOP @SALOME_USE_SINGLE_DESKTOP@)
+SET(SALOME_USE_PYSIDE         @SALOME_USE_PYSIDE@)
 SET(SALOME_GUI_USE_OBSERVERS  @SALOME_GUI_USE_OBSERVERS@)
 
 IF(SALOME_GUI_LIGHT_ONLY)
@@ -97,12 +98,23 @@ ENDIF()
 IF(NOT SALOME_USE_SALOMEOBJECT)
   LIST(APPEND GUI_DEFINITIONS "-DDISABLE_SALOMEOBJECT")
 ENDIF()
+IF(SALOME_USE_PYSIDE)
+  LIST(APPEND GUI_DEFINITIONS "-DWITH_PYSIDE")
+ELSE(SALOME_USE_PYSIDE) 
+  LIST(APPEND GUI_DEFINITIONS "--DWITH_PYQT4")
+ENDIF(SALOME_USE_PYSIDE)
 
 # Level 1 prerequisites:
 SET_AND_CHECK(KERNEL_ROOT_DIR_EXP "@PACKAGE_KERNEL_ROOT_DIR@")
-SET_AND_CHECK(SIP_ROOT_DIR_EXP "@PACKAGE_SIP_ROOT_DIR@")
+IF(SALOME_USE_PYSIDE)
+  SET_AND_CHECK(SHIBOKEN_ROOT_DIR_EXP "@PACKAGE_SHIBOKEN_ROOT_DIR@")
+  SET_AND_CHECK(PYSIDE_ROOT_DIR_EXP "@PACKAGE_PYSIDE_ROOT_DIR@")
+ELSE(SALOME_USE_PYSIDE)
+  SET_AND_CHECK(SIP_ROOT_DIR_EXP "@PACKAGE_SIP_ROOT_DIR@")
+ SET_AND_CHECK(PYQT4_ROOT_DIR_EXP "@PACKAGE_PYQT4_ROOT_DIR@")
+ENDIF(SALOME_USE_PYSIDE)
+
 SET_AND_CHECK(QT4_ROOT_DIR_EXP "@PACKAGE_QT4_ROOT_DIR@")
-SET_AND_CHECK(PYQT4_ROOT_DIR_EXP "@PACKAGE_PYQT4_ROOT_DIR@")
 SET_AND_CHECK(CAS_ROOT_DIR_EXP "@PACKAGE_CAS_ROOT_DIR@")    
 
 # Optional level 1 prerequisites:
index 0525b99f2fe12c06f349d1eba601b2520be27e75..59e352f769ccd1459fcb4b478110bdf510524d0c 100755 (executable)
@@ -30,12 +30,17 @@ SET(_adm_data
   FindSIP.cmake
   FindPyQt4.cmake
   FindSalomePyQt4.cmake
+  FindSalomePySide.cmake
   FindSalomeQt4.cmake
   FindSalomeQwt.cmake
   FindSalomeSIP.cmake
+  FindSalomeShiboken.cmake
   FindSalomeGUI.cmake
   FindSalomeOpenGL.cmake
   UsePyQt4.cmake
+  UsePySide.cmake
+  UsePySide.cmake
   UseQt4Ext.cmake
+  CommonTools.cmake
 )
 INSTALL(FILES ${_adm_data} DESTINATION ${SALOME_INSTALL_CMAKE_LOCAL})
diff --git a/adm_local/cmake_files/CommonTools.cmake b/adm_local/cmake_files/CommonTools.cmake
new file mode 100644 (file)
index 0000000..36c5bbd
--- /dev/null
@@ -0,0 +1,44 @@
+# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+
+####################################################################
+#
+# _GET_UNIQUE_TARGET_NAME: internal function
+# 
+# Used to generate unique custom target name for usage in
+# PYQT4_WRAP_UIC macro.
+#
+# USAGE: _PYQT4_WRAP_GET_UNIQUE_TARGET_NAME(prefix unique_name)
+#
+# ARGUMENTS:
+#   prefix [in] prefix for the name
+#   unique_name [out] unique name generated by function
+#
+####################################################################
+FUNCTION(_GET_UNIQUE_TARGET_NAME name unique_name)
+   SET(_propertyName "_PYQT4_WRAP_UNIQUE_COUNTER_${name}")
+   GET_PROPERTY(_currentCounter GLOBAL PROPERTY "${_propertyName}")
+   IF(NOT _currentCounter)
+      SET(_currentCounter 1)
+   ENDIF()
+   SET(${unique_name} "${name}_${_currentCounter}" PARENT_SCOPE)
+   MATH(EXPR _currentCounter "${_currentCounter} + 1")
+   SET_PROPERTY(GLOBAL PROPERTY ${_propertyName} ${_currentCounter} )
+ENDFUNCTION()
diff --git a/adm_local/cmake_files/FindPyTools.cmake b/adm_local/cmake_files/FindPyTools.cmake
new file mode 100644 (file)
index 0000000..152378b
--- /dev/null
@@ -0,0 +1,52 @@
+# Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# - Find PySide installation
+# Sets the following variables:
+#    PYSIDE_PYUIC_EXECUTABLE  - path to the pyside-uic executable
+#    PYSIDE_PYRCC_EXECUTABLE  - path to the pyside-rcc executable
+#    PYSIDE_PYUIC_PATH        - command to launch pyuic with the correct PYTHONPATH
+#    PYSIDE_PYRCC_PATH        - command to launch pyrcc with the correct PYTHONPATH
+#
+#  The executables
+#      pyside-uic and pyside-rcc are searched.
+
+IF(NOT PyTools_FIND_QUIETLY)
+  MESSAGE(STATUS "Looking for PyTools ...")
+ENDIF()
+
+FIND_PROGRAM(PYSIDE_PYUIC_EXECUTABLE NAMES pyside-uic)
+FIND_PROGRAM(PYSIDE_PYRCC_EXECUTABLE NAMES pyside-rcc)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PyTools REQUIRED_VARS PYSIDE_PYUIC_EXECUTABLE)
+
+# Wrap the final executables so that they always use the proper environment (PYTHONPATH):
+# The results are put to variables:
+#   PYSIDE_PYUIC_PATH - command to launch pyuic with the correct PYTHONPATH
+#   PYSIDE_PYRCC_PATH - command to launch pyrcc with the correct PYTHONPATH
+# TODO: should be done like Sphinx in KERNEL (i.e. generating a shell script)?
+
+IF(WIN32)
+  SET(PYSIDE_PYUIC_PATH set PYTHONPATH=${PYSIDE_PYTHONPATH};${SHIBOKEN_PYTHONPATH};%PYTHONPATH% && ${PYSIDE_PYUIC_EXECUTABLE})
+  SET(PYSIDE_PYRCC_PATH set PYTHONPATH=${PYSIDE_PYTHONPATH};${SHIBOKEN_PYTHONPATH};%PYTHONPATH% && ${PYSIDE_PYRCC_EXECUTABLE})
+ELSE()
+  SET(PYSIDE_PYUIC_PATH /usr/bin/env PYTHONPATH="${PYSIDE_PYTHONPATH}:${SHIBOKEN_PYTHONPATH}:$$PYTHONPATH" ${PYSIDE_PYUIC_EXECUTABLE})
+  SET(PYSIDE_PYRCC_PATH /usr/bin/env PYTHONPATH="${PYSIDE_PYTHONPATH}:${SHIBOKEN_PYTHONPATH}:$$PYTHONPATH" ${PYSIDE_PYRCC_EXECUTABLE})
+ENDIF()
index 856ad84a7b17e8cd4ed426122b1700fb65a6e6b7..2d9715034b3d3813208d50c53634bf147f7bd50f 100644 (file)
@@ -31,6 +31,7 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(PyQt4 PYQT_PYUIC_EXECUTABLE 2)
 MARK_AS_ADVANCED(PYQT_PYUIC_EXECUTABLE PYQT_PYRCC_EXECUTABLE PYQT_SIPS_DIR PYQT_PYUIC_PATH PYQT_PYRCC_PATH)
 
 IF(PYQT4_FOUND) 
+  SET(PYQT4_DEFINITIONS "-DWITH_PYQT4")
   SALOME_ACCUMULATE_ENVIRONMENT(PATH ${PYQT_PYUIC_EXECUTABLE})
   SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PYQT_PYTHONPATH})
   SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${PYQT_PYTHONPATH})
diff --git a/adm_local/cmake_files/FindSalomePySide.cmake b/adm_local/cmake_files/FindSalomePySide.cmake
new file mode 100644 (file)
index 0000000..9eb31b0
--- /dev/null
@@ -0,0 +1,54 @@
+# Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Roman NIKOLAEV
+#
+
+# PySide detection for Salome
+#
+#  !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+
+# PySide needs shiboken, call it automatically
+FIND_PACKAGE(SalomeShiboken REQUIRED)
+
+# Find the PySide
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(PySide PYSIDE_INCLUDE_DIR 2)
+
+# Find the pyside-uic and pyside-rcc executables
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(PyTools PYSIDE_PYUIC_EXECUTABLE 2)
+MARK_AS_ADVANCED(PYSIDE_PYUIC_EXECUTABLE PYSIDE_PYRCC_EXECUTABLE PYSIDE_PYUIC_PATH PYSIDE_PYRCC_PATH)
+
+# TODO : RNV : Check difference between Pakage_FOUND and PACKAGE_FOUND (in upper case and "as is") !!!
+IF(PySide_FOUND AND PYTOOLS_FOUND)
+  SALOME_ACCUMULATE_ENVIRONMENT(PATH ${PYSIDE_PYUIC_EXECUTABLE})
+  SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PYSIDE_PYTHONPATH})
+  SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${PYSIDE_PYTHONPATH})
+  
+  # Define shiboken generator options
+  SET(SIHBOKEN_GENERATOR_EXTRA_FLAGS --generator-set=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero)
+
+  # Define C++ preprocessor options
+  SET(PYSIDE_DEFINITIONS -DWITH_PYSIDE -DAVOID_PROTECTED_HACK)
+
+  # Costomize include directories
+  SET(PYSIDE_INCLUDE_DIRS ${PYSIDE_INCLUDE_DIR}
+      PYSIDE_INCLUDE_DIRS ${PYSIDE_INCLUDE_DIR}/QtCore
+      PYSIDE_INCLUDE_DIRS ${PYSIDE_INCLUDE_DIR}/QtGui
+      PYSIDE_INCLUDE_DIRS ${PYSIDE_INCLUDE_DIR}/QtXml)
+ENDIF()
diff --git a/adm_local/cmake_files/FindSalomeShiboken.cmake b/adm_local/cmake_files/FindSalomeShiboken.cmake
new file mode 100644 (file)
index 0000000..b782e8b
--- /dev/null
@@ -0,0 +1,34 @@
+# Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Roman NIKOLAEV
+#
+
+# Shiboken detection for Salome
+#
+#  !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Shiboken SHIBOKEN_BINARY 2)
+MARK_AS_ADVANCED(SHIBOKEN_BINARY SHIBOKEN_INCLUDE_DIR SHIBOKEN_LIBRARY)
+
+IF(SHIBOKEN_FOUND) 
+  SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SHIBOKEN_EXECUTABLE})
+  SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${SHIBOKEN_PYTHONPATH})
+  SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${SHIBOKEN_PYTHONPATH})
+ENDIF()
+
index 11d2d115020c543ca77ceb89f0ced901193f05f0..c38a2190aa6fbb35c0190e3a45df867aa0dbcf39 100644 (file)
 #
 # Author: Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 
-####################################################################
-#
-# _PYQT4_WRAP_GET_UNIQUE_TARGET_NAME: internal function
-# 
-# Used to generate unique custom target name for usage in
-# PYQT4_WRAP_UIC macro.
-#
-# USAGE: _PYQT4_WRAP_GET_UNIQUE_TARGET_NAME(prefix unique_name)
-#
-# ARGUMENTS:
-#   prefix [in] prefix for the name
-#   unique_name [out] unique name generated by function
-#
-####################################################################
-FUNCTION(_PYQT4_WRAP_GET_UNIQUE_TARGET_NAME name unique_name)
-   SET(_propertyName "_PYQT4_WRAP_UNIQUE_COUNTER_${name}")
-   GET_PROPERTY(_currentCounter GLOBAL PROPERTY "${_propertyName}")
-   IF(NOT _currentCounter)
-      SET(_currentCounter 1)
-   ENDIF()
-   SET(${unique_name} "${name}_${_currentCounter}" PARENT_SCOPE)
-   MATH(EXPR _currentCounter "${_currentCounter} + 1")
-   SET_PROPERTY(GLOBAL PROPERTY ${_propertyName} ${_currentCounter} )
-ENDFUNCTION()
+INCLUDE(CommonTools)
 
 ####################################################################
 #
diff --git a/adm_local/cmake_files/UsePySide.cmake b/adm_local/cmake_files/UsePySide.cmake
new file mode 100644 (file)
index 0000000..a790f22
--- /dev/null
@@ -0,0 +1,196 @@
+# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Roman NIKOLAEV, (roman.nikolaev@opencascade.com)
+
+INCLUDE(CommonTools)
+
+####################################################################
+#
+# PYSIDE_WRAP_UIC macro
+#
+# Create Python modules by processing input *.ui (Qt designer) files with
+# PySide pyside-uic tool.
+#
+# USAGE: PYSIDE_WRAP_UIC(output_files pyuic_files)
+#
+# ARGUMENTS:
+#   output_files [out] variable where output file names are listed to
+#   pyuic_files  [in]  list of *.ui files
+# 
+# NOTES:
+#   - Input files are considered relative to the current source directory.
+#   - Output files are generated in the current build directory.
+#   - Macro automatically adds custom build target to generate output files
+# 
+####################################################################
+MACRO(PYSIDE_WRAP_UIC outfiles)
+
+ IF(NOT WIN32)
+  FOREACH(_input ${ARGN})
+    GET_FILENAME_COMPONENT(_input_name ${_input} NAME)
+    STRING(REPLACE ".ui" "_ui.py" _input_name ${_input_name})
+    SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name})
+    ADD_CUSTOM_COMMAND(
+      OUTPUT ${_output}
+      COMMAND ${PYSIDE_PYUIC_PATH} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
+      MAIN_DEPENDENCY ${_input}
+      )
+    SET(${outfiles} ${${outfiles}} ${_output})
+  ENDFOREACH()
+  _GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _uniqueTargetName)
+  ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL DEPENDS ${${outfiles}})
+
+ ELSEIF(NOT WIN32)
+####
+# ANA: Workaround for the Microsoft Visual Studio 2010. Seems there is a bug in 
+# the Microsoft Visual Studio 2010 or CMake 2.8.10.2: custom target doesn't work 
+# for the list of the dependencies. It works only for the first dependency in the 
+# list. So generate separate target for the each input file. This problem will be 
+#investigated in the future.
+####
+
+  SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
+  _GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _uniqueTargetName)
+  ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL)
+  FOREACH(_input ${ARGN})
+    GET_FILENAME_COMPONENT(_input_name ${_input} NAME)
+    STRING(REPLACE ".ui" "_ui.py" _input_name ${_input_name})
+    SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name})
+    _GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _TgName)
+    ADD_CUSTOM_TARGET(${_TgName} ${PYSIDE_PYUIC_PATH} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
+      DEPENDS ${_input}
+      )
+    SET_TARGET_PROPERTIES(${_TgName} PROPERTIES FOLDER PYSIDE_WRAP_UIC_TARGETS)
+    ADD_DEPENDENCIES(${_uniqueTargetName} DEPEND ${_TgName})
+    SET(${outfiles} ${${outfiles}} ${_output})
+  ENDFOREACH()
+ ENDIF(NOT WIN32)
+ENDMACRO(PYSIDE_WRAP_UIC)
+
+####################################################################
+#
+# PYSIDE_WRAP_QRC macro
+#
+# Generate Python wrappings for *.qrc files by processing them with pyrcc4.
+#
+# USAGE: PYSIDE_WRAP_QRC(output_files qrc_files)
+#
+# ARGUMENTS:
+#   output_files [out] variable where output file names are listed to
+#   qrc_files  [in]  list of *.qrc files
+# 
+# NOTES:
+#   - Input files are considered relative to the current source directory.
+#   - Output files are generated in the current build directory.
+#   - Macro automatically adds custom build target to generate output files
+# 
+####################################################################
+
+MACRO(PYSIDE_WRAP_QRC outfiles)
+  FOREACH(_input ${ARGN})
+    GET_FILENAME_COMPONENT(_input_name ${_input} NAME)
+    STRING(REPLACE ".qrc" "_qrc.py" _input_name ${_input_name})
+    SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name})
+    ADD_CUSTOM_COMMAND(
+      OUTPUT ${_output}
+      COMMAND ${PYSIDE_PYRCC_PATH} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
+      MAIN_DEPENDENCY ${_input}
+      )
+    SET(${outfiles} ${${outfiles}} ${_output})
+  ENDFOREACH()
+  _GET_UNIQUE_TARGET_NAME(BUILD_QRC_PY_FILES _uniqueTargetName)
+  ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL DEPENDS ${${outfiles}})
+ENDMACRO(PYSIDE_WRAP_QRC)
+
+####################################################################
+#   
+# CREATE_PYSIDE_MODULE macro
+#
+# Create PySide module.
+#
+# USAGE: CREATE_PYSIDE_MODULE( module_name module_include_dir 
+#                              module_libraries module_global_file
+#                              module_dependencies module_timesystem_path 
+#                             module_sources module_gen_sources )
+#
+# ARGUMENTS:
+# module_name            [in] name of the PySide module.
+# module_global_file     [in] module global header file
+# module_include_dir     [in] list of the module include directories.
+# module_include_dir     [in] list of the libraries with witch to 
+#                             be module linked.
+# module_dependencies    [in] list of the module dependencies.
+# module_timesystem_path [in] list of the module typesystem paths.
+# module_sources         [in] module static sources.
+# module_gen_sources     [in] list of the sources to be generated.
+#
+# NOTES:
+#   - Output files are generated in the current build directory.
+#   - This version of macro requires class(es) definition in the *_typesystem.xml file.
+#
+####################################################################
+MACRO(CREATE_PYSIDE_MODULE MODULE_NAME MODULE_GLOBAL_FILE MODULE_INCLUDE_DIR MODULE_LIBRARIES MODULE_DEPS MODULE_TYPESYSTEM_PATH MODULE_SOURCES MODULE_GEN_SOURCES)
+
+  IF(${ARGC} GREATER 8)
+    SET(TYPESYSTEM_NAME ${ARGV8})
+  ELSE()
+        set (TYPESYSTEM_NAME "")
+  ENDIF()
+
+  IF(${ARGC} GREATER 9)
+    string(REPLACE ";" "\\;" DROPPED_ENTRIES "${${ARGV9}}")
+  ELSE()
+    SET (DROPPED_ENTRIES "")
+  ENDIF()
+        
+  IF(NOT EXISTS ${TYPESYSTEM_NAME})
+    SET(TYPESYSTEM_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${MODULE_NAME}_typesystem.xml)
+  ELSE()
+    SET(TYPESYSTEM_PATH ${TYPESYSTEM_NAME})
+  ENDIF()
+    
+  STRING(REPLACE ";" "${PATH_SEP}" _TMP_QT_INCLUDES "${QT_INCLUDES}")  
+  STRING(REPLACE ";" "${PATH_SEP}" _TMP_MODULE_INCLUDE_DIR "${${MODULE_INCLUDE_DIR}}") 
+
+  ADD_CUSTOM_COMMAND(OUTPUT ${${MODULE_GEN_SOURCES}}
+                     COMMAND ${SHIBOKEN_BINARY} ${SIHBOKEN_GENERATOR_EXTRA_FLAGS}
+                     ${MODULE_GLOBAL_FILE}
+                     --include-paths=${PYSIDE_INCLUDE_DIR}${PATH_SEP}${_TMP_QT_INCLUDES}${PATH_SEP}${_TMP_MODULE_INCLUDE_DIR}
+                     --typesystem-paths=${PYSIDE_TYPESYSTEMS}${PATH_SEP}${${MODULE_TYPESYSTEM_PATH}}
+                     --output-directory=${CMAKE_CURRENT_BINARY_DIR}
+                     --avoid-protected-hack
+                     ${TYPESYSTEM_PATH}
+                     --api-version="${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}"
+                     --drop-type-entries="${DROPPED_ENTRIES}"
+                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+                      COMMENT "Running shiboken generator for ${MODULE_NAME}..."
+                      MAIN_DEPENDENCY ${TYPESYSTEM_PATH})
+    
+  ADD_LIBRARY(${MODULE_NAME} ${${MODULE_SOURCES}} ${${MODULE_GEN_SOURCES}})
+  IF(WIN32)
+    SET_TARGET_PROPERTIES(${MODULE_NAME} PROPERTIES SUFFIX ".pyd")
+    SET(${MODULE_NAME}_SUFFIX ".pyd")
+  ELSE()
+    SET(${MODULE_NAME}_SUFFIX ${CMAKE_SHARED_MODULE_SUFFIX})
+  ENDIF()
+  TARGET_LINK_LIBRARIES(${MODULE_NAME} ${${MODULE_LIBRARIES}})
+  IF(${MODULE_DEPS})
+    ADD_DEPENDENCIES(${MODULE_NAME} ${${MODULE_DEPS}})
+  ENDIF()
+ENDMACRO()
\ No newline at end of file
index 496f5fa056da3fb335794d804060a61eb5eaf626..45449a884920611e726ccdb2bd7f9d3ba4f41d31 100755 (executable)
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-
-INCLUDE(UsePyQt4)
+IF(SALOME_USE_PYSIDE)
+  INCLUDE(UsePySide)
+ELSE(SALOME_USE_PYSIDE)
+  INCLUDE(UsePyQt4)
+ENDIF(SALOME_USE_PYSIDE)
 
 # --- resources ---
 
@@ -32,7 +35,13 @@ SET(_pyuic_files
 
 # scripts / pyuic wrappings
 
-PYQT4_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+IF(SALOME_USE_PYSIDE)
+  PYSIDE_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+ELSE(SALOME_USE_PYSIDE)
+  PYQT4_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+ENDIF(SALOME_USE_PYSIDE)
+
+
 
 # scripts / static
 SET(_other_SCRIPTS 
index 32d2cb98417a4c6f52983b1b8158ba620a78ad8d..1d0f07aff62cecdf77802965a1a1b137932a4191 100755 (executable)
@@ -42,13 +42,22 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/SalomeApp
 )
 
+
+
 # additional preprocessor / compiler flags
+IF(SALOME_USE_PYSIDE)
+  SET(PACKAGE_DEFINITIONS ${PYSIDE_DEFINITIONS})
+ELSE(SALOME_USE_PYSIDE)
+  SET(PACKAGE_DEFINITIONS ${PYQT4_DEFINITIONS})
+ENDIF(SALOME_USE_PYSIDE)
+
 ADD_DEFINITIONS(
   ${QT_DEFINITIONS}
   ${CAS_DEFINITIONS} 
   ${PYTHON_DEFINITIONS}
   ${BOOST_DEFINITIONS}
   ${OMNIORB_DEFINITIONS}
+  ${PACKAGE_DEFINITIONS}
 )
 
 # libraries to link to
index 4b73279a700c3c34c38c8323852d078342d20d0c..e5a1e3a68f51a71403ec73236faa54bd67223dc5 100644 (file)
 // and to get C API from sip : sipBuildResult for example
 //
 
-#define INIT_FUNCTION initSalomePyQtGUILight
-#if defined(SIP_STATIC_MODULE)
-extern "C" void INIT_FUNCTION();
-#else
-PyMODINIT_FUNC INIT_FUNCTION();
-#endif
+#ifdef WITH_PYQT4
+  #define INIT_FUNCTION initSalomePyQtGUILight
+    #if defined(SIP_STATIC_MODULE)
+      extern "C" void INIT_FUNCTION();
+    #else
+    PyMODINIT_FUNC INIT_FUNCTION();
+  #endif //SIP_STATIC_MODULE
+#endif //WITH_PYQT4
+
+#ifdef WITH_PYSIDE
+  #define INIT_FUNCTION initSalomePyQtGUILight
+  extern "C" void INIT_FUNCTION();
+#endif //WITH_PYSIDE
 
 /*!
   \fn CAM_Module* createModule()
index cf8cc6cf720fd3cbf0a3c2583172f8beb685b444..f3aad6850e0a880a8dc3b6339fb12aa63fc2dc7a 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(UsePyQt4)
+IF(SALOME_USE_PYSIDE)
+  SET(PACKAGE_DEFINITIONS ${PYSIDE_DEFINITIONS})
+  INCLUDE(UsePySide)
+ELSE(SALOME_USE_PYSIDE)
+  INCLUDE(UsePyQt4)
+  SET(PACKAGE_DEFINITIONS ${PYQT4_DEFINITIONS})
+ENDIF(SALOME_USE_PYSIDE)
+
 IF(SALOME_USE_VTKVIEWER)
   INCLUDE(${VTK_USE_FILE})
 ENDIF()
 
 # --- options ---
 
-# additional include directories
-INCLUDE_DIRECTORIES(
+# --- common include directories ---
+SET(SalomePyQtGUILight_INCLUDE_DIRS
   ${CAS_INCLUDE_DIRS}
   ${QT_INCLUDES}
-  ${SIP_INCLUDE_DIR}
   ${PYTHON_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${CMAKE_CURRENT_BINARY_DIR}
@@ -44,26 +50,51 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/SUIT
   ${PROJECT_SOURCE_DIR}/src/SUITApp
   ${PROJECT_SOURCE_DIR}/src/ObjBrowser
-)
+  )
+
+# additional include directories
+IF(SALOME_USE_PYSIDE)
+  SET(SalomePyQtGUILight_INCLUDE_DIRS
+      ${SalomePyQtGUILight_INCLUDE_DIRS}
+      ${CMAKE_CURRENT_BINARY_DIR}/SalomePyQtGUILight
+      ${SHIBOKEN_INCLUDE_DIR}
+      ${PYSIDE_INCLUDE_DIRS})
+ELSE(SALOME_USE_PYSIDE)
+  SET(SalomePyQtGUILight_INCLUDE_DIRS
+      ${SalomePyQtGUILight_INCLUDE_DIRS}
+      ${SIP_INCLUDE_DIRS})
+ENDIF(SALOME_USE_PYSIDE)
+
+INCLUDE_DIRECTORIES(${SalomePyQtGUILight_INCLUDE_DIRS})
 
 # additional preprocessor / compiler flags
+IF(SALOME_USE_PYSIDE)
+  SET(PACKAGE_DEFINITIONS ${PYSIDE_DEFINITIONS})
+ELSE(SALOME_USE_PYSIDE)
+  SET(PACKAGE_DEFINITIONS ${PYQT4_DEFINITIONS})
+ENDIF(SALOME_USE_PYSIDE)
+
 ADD_DEFINITIONS(
   ${QT_DEFINITIONS}
   ${CAS_DEFINITIONS}
   ${PYTHON_DEFINITIONS}
-)
+  ${PACKAGE_DEFINITIONS})
 
 # libraries to link to
 SET(_link_LIBRARIES
   ${PYTHON_LIBRARIES}
   ${VTK_LIBRARIES}
   ${OPENGL_LIBRARIES}
-  LightApp
-)
+  LightApp)
+
 IF(NOT SALOME_LIGHT_ONLY)
   LIST(APPEND _link_LIBRARIES ${KERNEL_SalomeContainer})
 ENDIF()
 
+IF(SALOME_USE_PYSIDE)
+  LIST(APPEND _link_LIBRARIES ${SHIBOKEN_LIBRARY} ${PYSIDE_LIBRARY})
+ENDIF(SALOME_USE_PYSIDE)
+
 # --- headers ---
 
 # header files / to be processed by moc
@@ -84,18 +115,16 @@ SET(_other_HEADERS
 SET(SalomePyQtGUILight_HEADERS ${_moc_HEADERS} ${_other_HEADERS})
 
 # --- resources ---
-
-# sip files / to be processed by sip
-SET(_sip_files SALOME_PYQT_GUILight.sip)
+IF(NOT SALOME_USE_PYSIDE)
+  # sip files / to be processed by sip
+  SET(_sip_files SALOME_PYQT_GUILight.sip)
+ENDIF(NOT SALOME_USE_PYSIDE)
 
 # --- sources ---
 
 # sources / moc wrappings
 QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
 
-# sources / sip wrappings
-PYQT4_WRAP_SIP(_sip_SOURCES ${_sip_files})
-
 # sources / static
 SET(_other_SOURCES
   SALOME_PYQT_DataModelLight.cxx
@@ -105,16 +134,44 @@ SET(_other_SOURCES
   SALOME_PYQT_PyModule.cxx
 )
 
-# sources / to compile
-SET(SalomePyQtGUILight_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_sip_SOURCES})
+SET(SalomePyQtGUILight_SOURCES ${_other_SOURCES} ${_moc_SOURCES})
 
-# --- rules ---
 
-ADD_LIBRARY(SalomePyQtGUILight ${SalomePyQtGUILight_SOURCES})
-TARGET_LINK_LIBRARIES(SalomePyQtGUILight ${_link_LIBRARIES})
-INSTALL(TARGETS SalomePyQtGUILight DESTINATION ${SALOME_INSTALL_LIBS})
+IF(SALOME_USE_PYSIDE)
+
+  # --- create pyside module ---
+  SET(SalomePyQtGUILight_WRAPPED_SOURCES
+      ${CMAKE_CURRENT_BINARY_DIR}/SalomePyQtGUILight/salomepyqtguilight_module_wrapper.cpp)
+
+  CREATE_PYSIDE_MODULE(
+    SalomePyQtGUILight
+    ${CMAKE_CURRENT_SOURCE_DIR}/SALOME_PYQT_GUILight_global.h
+    ""
+    _link_LIBRARIES
+    ""
+    ""
+    SalomePyQtGUILight_SOURCES
+    SalomePyQtGUILight_WRAPPED_SOURCES
+    ${CMAKE_CURRENT_SOURCE_DIR}/SALOME_PYQT_GUILight_typesystem.xml
+  )
+ELSE(SALOME_USE_PYSIDE)
+  # sources / sip wrappings
+  PYQT4_WRAP_SIP(_sip_SOURCES ${_sip_files})
 
+  # sources / to compile
+  SET(SalomePyQtGUILight_SOURCES ${SalomePyQtGUILight_SOURCES} ${_sip_SOURCES})
+
+  # --- rules ---
+
+  ADD_LIBRARY(SalomePyQtGUILight ${SalomePyQtGUILight_SOURCES})
+  TARGET_LINK_LIBRARIES(SalomePyQtGUILight ${_link_LIBRARIES})
+ENDIF(SALOME_USE_PYSIDE)
+
+INSTALL(TARGETS SalomePyQtGUILight DESTINATION ${SALOME_INSTALL_LIBS})
 INSTALL(FILES ${SalomePyQtGUILight_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
 
-FILE(GLOB make_clean_files ${CMAKE_CURRENT_BINARY_DIR}/sip*)
+IF(SALOME_USE_PYSIDE)
+  FILE(GLOB make_clean_files ${CMAKE_CURRENT_BINARY_DIR}/sip*)
+ENDIF(SALOME_USE_PYSIDE)
+
 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}")
diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_GUILight_global.h b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_GUILight_global.h
new file mode 100644 (file)
index 0000000..3ae5adb
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File   : SALOME_PYQT_ModuleLight_global.h
+// Author : Roman NIKOLAEV, (roman.nikolaev@opencascade.com)
+
+#undef QT_NO_STL
+#undef QT_NO_STL_WCHAR
+#ifndef NULL
+#define NULL    0
+#endif
+#include "pyside_global.h"
+#include <QStringList.h>
diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_GUILight_typesystem.xml b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_GUILight_typesystem.xml
new file mode 100644 (file)
index 0000000..6b3a952
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+
+<!--
+   Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+
+   Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+   CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+   
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+   
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+   
+   See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+   
+   File   : SALOME_PYQT_GUILight_typesystem.xml
+   Author : Roman NIKOLAEV, Open CASCADE S.A.S. (roman.nikolaev@opencascade.com)   
+-->
+
+<typesystem package="SalomePyQtGUILight">
+  <load-typesystem name="typesystem_core.xml" generate="no"/>
+  <load-typesystem name="typesystem_gui.xml" generate="no"/>
+</typesystem>
index da7043dbd9a0e06e657a0bfbea63f61b999dcc4a..4b4ce7cdcc02873d4cdcfcdffffdb1adf7033804 100644 (file)
 #include "SUIT_DataObjectIterator.h"
 #include "LightApp_Application.h"
 #include "SUIT_DataBrowser.h"
+
+#ifdef WITH_PYQT4
 #include "sipAPISalomePyQtGUILight.h"
+#endif
+
+#ifdef WITH_PYSIDE
+#include "salomepyqtguilight_python.h"
+#endif
 
 #ifndef GUI_DISABLE_CORBA
 #include <Container_init_python.hxx>
 // and to get C API from sip : sipBuildResult for example
 //
 
-#define INIT_FUNCTION initSalomePyQtGUILight
-#if defined(SIP_STATIC_MODULE)
-extern "C" void INIT_FUNCTION();
-#else
-PyMODINIT_FUNC INIT_FUNCTION();
-#endif
+#ifdef WITH_PYQT4
+  #define INIT_FUNCTION initSalomePyQtGUILight
+    #if defined(SIP_STATIC_MODULE)
+      extern "C" void INIT_FUNCTION();
+    #else
+    PyMODINIT_FUNC INIT_FUNCTION();
+  #endif //SIP_STATIC_MODULE
+#endif //WITH_PYQT4
+
+#ifdef WITH_PYSIDE
+  #define INIT_FUNCTION initSalomePyQtGUILight
+  extern "C" void INIT_FUNCTION();
+#endif //WITH_PYSIDE
 
 /*!
   \fn CAM_Module* createModule()
index 4a21a408591b1eb287ef66e1b05e11faf242fa28..1e8b9e567d94915be3038742341ee3d3be5daa1b 100644 (file)
 
 #include <utilities.h>
 
+#ifdef WITH_PYQT4
 #include "sipAPISalomePyQtGUILight.h"
+#endif
+
+#ifdef WITH_PYSIDE
+#include <shiboken.h>
+#include <salomepyqtguilight_python.h>
+#endif
 
 /*!
   \brief Default menu group number.
@@ -1809,10 +1816,16 @@ void PyModuleHelper::setWorkSpace()
     if ( d )
       aWorkspace = d->workstack();
   }
+#ifdef WITH_PYQT4
 #if SIP_VERSION < 0x040800
   PyObjWrapper pyws( sipBuildResult( 0, "M", aWorkspace, sipClass_QWidget) );
 #else
   PyObjWrapper pyws( sipBuildResult( 0, "D", aWorkspace, sipType_QWidget , NULL) );
+#endif
+#endif
+  
+#ifdef WITH_PYSIDE
+  PyObjWrapper pyws(Shiboken::Converter<QWidget*>::toPython(aWorkspace));
 #endif
   // ... and finally call Python module's setWorkSpace() method (obsolete)
   if ( PyObject_HasAttrString( myPyModule, (char*)"setWorkSpace" ) ) {
@@ -1898,11 +1911,19 @@ void PyModuleHelper::internalInitialize( CAM_Application* app )
           // parse the return value
           // it should be a map: {integer:integer}
           int aKey, aValue;
+#ifdef WITH_PYQT4        
           if( key && PyInt_Check( key ) && value && PyInt_Check( value ) ) {
-            aKey   = PyInt_AsLong( key );
+           aKey   = PyInt_AsLong( key );
             aValue = PyInt_AsLong( value );
-            myWindowsMap[ aKey ] = aValue;
-          }
+         }
+#endif
+#ifdef WITH_PYSIDE
+         if( key && Shiboken::isShibokenEnum(key) && value && Shiboken::isShibokenEnum(value) ) {
+           aKey = Shiboken::Enum::getValue(key);
+           aValue = Shiboken::Enum::getValue(value);
+           myWindowsMap[ aKey ] = aValue;
+         }
+#endif
         }
       }
     }
@@ -2259,11 +2280,16 @@ void PyModuleHelper::internalContextMenu( const QString& context, QMenu* menu )
   // we create popup menus without help of QtxPopupMgr
   if ( myXmlHandler )
     myXmlHandler->createPopup( menu, aContext, aParent, aObject );
-
+#ifdef WITH_PYQT4
 #if SIP_VERSION < 0x040800
-  PyObjWrapper sipPopup( sipBuildResult( 0, "M", menu, sipClass_QMenu ) );
+  PyObjWrapper aPopup( sipBuildResult( 0, "M", menu, sipClass_QMenu ) );
 #else
-  PyObjWrapper sipPopup( sipBuildResult( 0, "D", menu, sipType_QMenu, NULL ) );
+  PyObjWrapper aPopup( sipBuildResult( 0, "D", menu, sipType_QMenu, NULL ) );
+#endif
+#endif
+
+#ifdef WITH_PYSIDE
+  PyObjWrapper aPopup( Shiboken::Converter<QMenu*>::toPython(menu) );
 #endif
 
   // then call Python module's createPopupMenu() method (for new modules)
@@ -2271,7 +2297,7 @@ void PyModuleHelper::internalContextMenu( const QString& context, QMenu* menu )
     PyObjWrapper res1( PyObject_CallMethod( myPyModule,
                                             (char*)"createPopupMenu",
                                             (char*)"Os",
-                                            sipPopup.get(),
+                                            aPopup.get(),
                                             context.toLatin1().constData() ) );
     if( !res1 ) {
       PyErr_Print();
@@ -2284,7 +2310,7 @@ void PyModuleHelper::internalContextMenu( const QString& context, QMenu* menu )
     PyObjWrapper res2( PyObject_CallMethod( myPyModule,
                                             (char*)"customPopup",
                                             (char*)"Osss",
-                                            sipPopup.get(),
+                                            aPopup.get(),
                                             aContext.toLatin1().constData(),
                                             aObject.toLatin1().constData(),
                                             aParent.toLatin1().constData() ) );
@@ -2471,14 +2497,21 @@ void PyModuleHelper::internalLoad( const QStringList& files, bool& opened )
 
   QStringList* theList = new QStringList( files );
 
+
+#ifdef WITH_PYQT4
 #if SIP_VERSION < 0x040800
-  PyObjWrapper sipList( sipBuildResult( 0, "M", theList, sipClass_QStringList ) );
+  PyObjWrapper aList( sipBuildResult( 0, "M", theList, sipClass_QStringList ) );
 #else
-  PyObjWrapper sipList( sipBuildResult( 0, "D", theList, sipType_QStringList, NULL ) );
+  PyObjWrapper aList( sipBuildResult( 0, "D", theList, sipType_QStringList, NULL ) );
+#endif
+#endif
+
+#ifdef WITH_PYSIDE
+  PyObjWrapper aList(Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], &files));
 #endif
   if ( PyObject_HasAttrString(myPyModule , (char*)"openFiles") ) {
     PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"openFiles",
-                                           (char*)"O", sipList.get()));
+                                           (char*)"O", aList.get()));
     if( !res || !PyBool_Check( res )) {
       PyErr_Print();
       opened = false;
@@ -2625,14 +2658,21 @@ void PyModuleHelper::internalDropObjects( const DataObjectList& what, SUIT_DataO
     if ( dataObject ) theList->append( dataObject->entry() );
   }
 
+#ifdef WITH_PYQT4
 #if SIP_VERSION < 0x040800
-  PyObjWrapper sipList( sipBuildResult( 0, "M", theList, sipClass_QStringList) );
+  PyObjWrapper aList( sipBuildResult( 0, "M", theList, sipClass_QStringList) );
 #else
-  PyObjWrapper sipList( sipBuildResult( 0, "D", theList, sipType_QStringList, NULL) );
+  PyObjWrapper aList( sipBuildResult( 0, "D", theList, sipType_QStringList, NULL) );
+#endif
 #endif
+
+#ifdef WITH_PYSIDE
+  PyObjWrapper aList(Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], &theList));
+#endif
+
   if ( PyObject_HasAttrString(myPyModule, (char*)"dropObjects") ) {
       PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"dropObjects", (char*)"Osii",
-                        sipList.get(),
+                        aList.get(),
                         whereObject->entry().toLatin1().constData(),
                         row, action ) );
     
index 692883aac15a6d27a3e49a917d4082a23ff5ab23..63b7fc70661082d5a984af939c51ea1ec3e3cc54 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(UsePyQt4)
+IF(SALOME_USE_PYSIDE)
+  INCLUDE(UsePySide)
+ELSE(SALOME_USE_PYSIDE)
+  INCLUDE(UsePyQt4)
+ENDIF(SALOME_USE_PYSIDE)
 IF(SALOME_USE_VTKVIEWER)
   INCLUDE(${VTK_USE_FILE})
 ENDIF()
 
 # --- options ---
 
-# additional include directories
-INCLUDE_DIRECTORIES(
+# --- common include directories ---
+SET(SalomePyQt_INCLUDE_DIRS
   ${CAS_INCLUDE_DIRS}
   ${QT_INCLUDES}
   ${QWT_INCLUDE_DIR}
@@ -48,6 +52,23 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/SUIT
 )
 
+# additional include directories
+IF(SALOME_USE_PYSIDE)
+  SET(SalomePyQt_INCLUDE_DIRS
+      ${SalomePyQt_INCLUDE_DIRS}
+      ${CMAKE_CURRENT_BINARY_DIR}/SalomePyQt
+      ${SHIBOKEN_INCLUDE_DIR}
+      ${PYSIDE_INCLUDE_DIRS})
+ELSE(SALOME_USE_PYSIDE)
+  SET(SalomePyQt_INCLUDE_DIRS
+      ${SalomePyQt_INCLUDE_DIRS}
+      ${SIP_INCLUDE_DIRS})
+ENDIF(SALOME_USE_PYSIDE)
+
+INCLUDE_DIRECTORIES(
+ ${SalomePyQt_INCLUDE_DIRS}
+)
+
 IF(SALOME_LIGHT_ONLY)
   #disable 'ENABLE_CORBA' feature
   SET(PYQT_SIPFLAGS ${PYQT_SIPFLAGS} "-xENABLE_CORBA;")
@@ -58,6 +79,15 @@ ELSE(SALOME_LIGHT_ONLY)
 ENDIF(SALOME_LIGHT_ONLY)
 
 # additional preprocessor / compiler flags
+
+# additional preprocessor / compiler flags
+IF(SALOME_USE_PYSIDE)
+  SET(PACKAGE_DEFINITIONS ${PYSIDE_DEFINITIONS})
+ELSE(SALOME_USE_PYSIDE)
+  SET(PACKAGE_DEFINITIONS ${PYQT4_DEFINITIONS})
+ENDIF(SALOME_USE_PYSIDE)
+
+
 ADD_DEFINITIONS(
   ${QWT_DEFINITIONS}
   ${QT_DEFINITIONS}
@@ -65,7 +95,7 @@ ADD_DEFINITIONS(
   ${BOOST_DEFINITIONS}
   ${PYTHON_DEFINITIONS}
   ${OMNIORB_DEFINITIONS}
-)
+  ${PACKAGE_DEFINITIONS})
 
 # libraries to link to
 SET(_link_LIBRARIES
@@ -84,15 +114,19 @@ SET(_moc_HEADERS SalomePyQt.h)
 # --- resources ---
 
 # sip files / to be processed by sip
-SET(_sip_files SalomePyQt.sip)
+IF(NOT SALOME_USE_PYSIDE)
+  SET(_sip_files SalomePyQt.sip)
+ENDIF(NOT SALOME_USE_PYSIDE)
 
 # --- sources ---
 
 # sources / moc wrappings
 QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
 
-# sources / sip wrappings
-PYQT4_WRAP_SIP(_sip_SOURCES ${_sip_files})
+IF(NOT SALOME_USE_PYSIDE)
+  # sources / sip wrappings
+  PYQT4_WRAP_SIP(_sip_SOURCES ${_sip_files})
+ENDIF(NOT SALOME_USE_PYSIDE)
 
 # sources / static
 SET(_other_SOURCES SalomePyQt.cxx)
@@ -101,16 +135,52 @@ SET(_other_SOURCES SalomePyQt.cxx)
 SET(SalomePyQt_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_sip_SOURCES})
 
 # --- rules ---
+IF(SALOME_USE_PYSIDE)
+
+  # --- list of the wrapped sources ---
+  SET(SalomePyQt_WRAPPED_SOURCES 
+  ${CMAKE_CURRENT_BINARY_DIR}/SalomePyQt/salomepyqt_module_wrapper.cpp
+  ${CMAKE_CURRENT_BINARY_DIR}/SalomePyQt/salome_selection_wrapper.cpp
+  ${CMAKE_CURRENT_BINARY_DIR}/SalomePyQt/qtxaction_wrapper.cpp
+  ${CMAKE_CURRENT_BINARY_DIR}/SalomePyQt/qtxactionset_wrapper.cpp
+  ${CMAKE_CURRENT_BINARY_DIR}/SalomePyQt/qtxactiongroup_wrapper.cpp
+  ${CMAKE_CURRENT_BINARY_DIR}/SalomePyQt/plot2d_curve_wrapper.cpp
+  ${CMAKE_CURRENT_BINARY_DIR}/SalomePyQt/salomepyqt_wrapper.cpp)
+
+  # --- module include directories ---
+  SET(SalomePy_MODULE_INCLUDES
+  ${PROJECT_SOURCE_DIR}/src/Qtx
+  ${PROJECT_SOURCE_DIR}/src/Plot2d)
+
+
+  # --- create pyside module ---
+  MESSAGE("Create pyside module in the ${CAMKE_CURRENT_SOURCE_DIR}")
+  CREATE_PYSIDE_MODULE(
+    SalomePyQt
+    ${CMAKE_CURRENT_SOURCE_DIR}/SalomePyQt_global.h
+    SalomePy_MODULE_INCLUDES
+    _link_LIBRARIES
+    ""
+    ""
+    SalomePyQt_SOURCES
+    SalomePyQt_WRAPPED_SOURCES
+    ${CMAKE_CURRENT_SOURCE_DIR}/SalomePyQt_typesystem.xml
+  )
 
-ADD_LIBRARY(SalomePyQt ${SalomePyQt_SOURCES})
-TARGET_LINK_LIBRARIES(SalomePyQt ${_link_LIBRARIES})
-INSTALL(TARGETS SalomePyQt DESTINATION ${SALOME_INSTALL_LIBS})
+ELSE(SALOME_USE_PYSIDE)
+  ADD_LIBRARY(SalomePyQt ${SalomePyQt_SOURCES})
+  TARGET_LINK_LIBRARIES(SalomePyQt ${_link_LIBRARIES})
+ENDIF(SALOME_USE_PYSIDE)
 
+# --- set prefix ---
+SET_TARGET_PROPERTIES(SalomePyQt PROPERTIES PREFIX "")
+
+# --- set correct names of the library on win32 platform ---
 IF(WIN32)
   SET_TARGET_PROPERTIES(SalomePyQt PROPERTIES SUFFIX ".pyd" DEBUG_OUTPUT_NAME SalomePyQt_d RELEASE_OUTPUT_NAME SalomePyQt)
-ELSE()
-  SET_TARGET_PROPERTIES(SalomePyQt PROPERTIES PREFIX "")
-ENDIF()
+ENDIF(WIN32)
+
+INSTALL(TARGETS SalomePyQt DESTINATION ${SALOME_INSTALL_LIBS})
 
 FILE(GLOB make_clean_files ${CMAKE_CURRENT_BINARY_DIR}/sip*)
 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}")
index e9956afd4ffb74fb541d7a5774a602d6420f90fe..8adcc18a9a05246a4c28fe6e134caf3e9de150ba 100644 (file)
@@ -81,7 +81,7 @@ enum MenuName {
   Help        = 7  
 };
 
-enum {
+enum WindowType {
   WT_ObjectBrowser = LightApp_Application::WT_ObjectBrowser,
   WT_PyConsole     = LightApp_Application::WT_PyConsole,
   WT_LogWindow     = LightApp_Application::WT_LogWindow,
@@ -93,7 +93,7 @@ enum {
 #endif
 };
 
-enum 
+enum PrefType {
   PT_Auto     = LightApp_Preferences::Auto,
   PT_Space    = LightApp_Preferences::Space,
   PT_Bool     = LightApp_Preferences::Bool, 
diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt_global.h b/src/SALOME_PYQT/SalomePyQt/SalomePyQt_global.h
new file mode 100644 (file)
index 0000000..383934e
--- /dev/null
@@ -0,0 +1,34 @@
+// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File   : SalomePyQt_global.h
+// Author : Roman NIKOLAEV, (roman.nikolaev@opencascade.com)
+
+#undef QT_NO_STL
+#undef QT_NO_STL_WCHAR
+#ifndef NULL
+#define NULL    0
+#endif
+#include "pyside_global.h"
+
+#include <SalomePyQt.h>
+#include <QtxAction.h>
+#include <QtxActionSet.h>
+#include <QtxActionGroup.h>
+#include <Plot2d_Curve.h>
diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt_typesystem.xml b/src/SALOME_PYQT/SalomePyQt/SalomePyQt_typesystem.xml
new file mode 100644 (file)
index 0000000..0280b1b
--- /dev/null
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+
+<!--
+   Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+
+   Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+   CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+   
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+   
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+   
+   See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+   
+   File   : SalomePyQt_typesystem.xml
+   Author : Roman NIKOLAEV, Open CASCADE S.A.S. (roman.nikolaev@opencascade.com)   
+-->
+
+
+
+<typesystem package="SalomePyQt">
+  <load-typesystem name="typesystem_gui.xml" generate="no"/>
+  <load-typesystem name="typesystem_xml.xml" generate="no"/>
+
+  <enum-type name="MenuName"/>
+  <enum-type name="WindowType"/>
+  <enum-type name="PrefType"/>
+  <enum-type name="Orientation"/>
+  <enum-type name="Action"/>
+  <enum-type name="Axis"/>
+  <enum-type name="ObjectType"/>
+  <enum-type name="VisibilityState"/>
+
+  <object-type name="SALOME_Selection"/>
+  <object-type name="QtxAction"/>
+  <object-type name="QtxActionSet"/>
+  <object-type name="QtxActionGroup"/>
+  <object-type name="Plot2d_Curve"/>
+  <object-type name="SalomePyQt">
+
+  <rejection class="Plot2d_Curve" function-name="getDeviationData"/>
+  <rejection class="Plot2d_Curve" function-name="setDeviationData"/>
+
+    <modify-function signature="addPreference( const QString&amp;, const int, const int ,const QString&amp;, const QString&amp;)">
+      <!--Workaround to avoid a problem with the shiboken generator and global enumerations -->
+      <modify-argument index="3">
+        <replace-default-expression with="PT_Auto "/>
+      </modify-argument>
+    </modify-function>
+
+    <modify-function signature="getActivePythonModule()">
+      <modify-argument index="return">
+       <conversion-rule class="target">
+         %PYARG_0 = %0;
+          </conversion-rule>
+      </modify-argument>
+    </modify-function>    
+  </object-type>
+</typesystem>
index fc63c95b4dfe480c37382519e64563197c797cf8..9f26409205a26ce95412f8e306b2e6508df95240 100644 (file)
@@ -44,7 +44,7 @@ name salome_plugins.py (example follows)::
   import salome_pluginsmanager
 
   def about(context):
-    from PyQt4.QtGui import QMessageBox
+    from PySide.QtGui import QMessageBox
     QMessageBox.about(None, "About SALOME pluginmanager", "SALOME plugins manager in SALOME virtual application ")
 
   salome_pluginsmanager.AddFunction('About plugins','About SALOME pluginmanager',about)
@@ -84,8 +84,8 @@ context attributes:
 """
 
 import os,sys,traceback
-from PyQt4 import QtGui
-from PyQt4 import QtCore
+from PySide import QtGui
+from PySide import QtCore
 
 import salome