]> SALOME platform Git repositories - tools/yacsgen.git/commitdiff
Salome HOME
Qt5 update. V8_1_0a1
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Mon, 4 Jul 2016 15:37:59 +0000 (17:37 +0200)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Mon, 4 Jul 2016 15:37:59 +0000 (17:37 +0200)
Examples/cppgui1/cppcomposGUI.cxx
Examples/pygui1/pycomposGUI.py
module_generator/gui_tmpl.py
module_generator/mod_tmpl.py

index 2e1de6563f131f496722e2c9a8275f7e28f62e0b..e7dec692ae88a86f077dbc1bc8ff6d9f13dc2f16 100644 (file)
@@ -135,7 +135,7 @@ bool cppcomposGUI::deactivateModule( SUIT_Study* theStudy )
 void cppcomposGUI::OnGetBanner()
 {
   // Dialog to get the Name
-  bool ok = FALSE;
+  bool ok = false;
   QString myName = QInputDialog::getText( getApp()->desktop(), "label", "name", QLineEdit::Normal, QString::null, &ok );
 
   if ( ok && !myName.isEmpty()) 
index dc720f773cb4e8059a821d84237ca6b62c21faa0..e2e3d61d37d853d813b171243eb92016fbe7804f 100644 (file)
 
 import os
 
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
-from PyQt4.QtWebKit import *
-from PyQt4 import QtCore, QtGui, uic
+from PyQt5.QtCore import *
+from PyQt5.QtWidgets import *
+from PyQt5 import QtCore, uic, QtWidgets
+from PyQt5.QtWebKitWidgets import QWebView
 
 import salome
 import pycompos_ORB
@@ -101,7 +101,7 @@ def getEngine():
 ###
 def CreateObject():
     global __objectid__
-    default_name = str( sgPyQt.stringSetting( "pycompos", "def_obj_name", "Object" ).trimmed() )
+    default_name = str( sgPyQt.stringSetting( "pycompos", "def_obj_name", "Object" ).lstrip().rstrip() )
     # generate object name
     __objectid__  = __objectid__ + 1
     name = "%s_%d" % ( default_name, __objectid__ )
@@ -111,7 +111,7 @@ def CreateObject():
     print getEngine().ComponentDataType()
     sg.updateObjBrowser( True )
 
-class DemoImpl(QtGui.QDialog):
+class DemoImpl(QtWidgets.QDialog):
     def __init__(self, *args):
         super(DemoImpl, self).__init__(*args)
 
index 4fef5c42af2d7957df94ae137d366be7ad0f3516..5b5237c348576058945339073dac3fe8b498cfda 100644 (file)
@@ -82,7 +82,7 @@ cppsalomeapp=Template(cppsalomeapp)
 #   resources : resource files
 #   ts_resources : .ts files - to be processed by lrelease
 cmake_cpp_gui = """
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
 
 # --- options ---
 # additional include directories
@@ -125,13 +125,12 @@ SET(_moc_HEADERS
 )
 
 # header files / uic wrappings
-QT4_WRAP_UI(_uic_HEADERS $${_uic_files})
+QT_WRAP_UIC(_uic_HEADERS $${_uic_files})
 
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES $${_moc_HEADERS})
-
+QT_WRAP_MOC(_moc_SOURCES $${_moc_HEADERS})  
 
 # sources / static
 SET(_other_SOURCES
@@ -165,7 +164,7 @@ INSTALL(TARGETS ${module} EXPORT $${PROJECT_NAME}TargetGroup DESTINATION $${SALO
 
 INSTALL(FILES $${_moc_HEADERS} DESTINATION $${SALOME_INSTALL_HEADERS})
 INSTALL(FILES $${_res_files} DESTINATION "$${SALOME_${module}_INSTALL_RES_DATA}")
-QT4_INSTALL_TS_RESOURCES("$${_ts_files}" "$${SALOME_${module}_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("$${_ts_files}" "$${SALOME_${module}_INSTALL_RES_DATA}")
 """
 cmake_cpp_gui = Template(cmake_cpp_gui)
 
@@ -176,7 +175,7 @@ cmake_cpp_gui = Template(cmake_cpp_gui)
 #   ts_resources : .ts files - to be processed by lrelease
 #   resources : other resource files
 cmake_py_gui = """
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
 
 # additional include directories
 INCLUDE_DIRECTORIES(
@@ -206,6 +205,6 @@ SET(_res_files
 
 SALOME_INSTALL_SCRIPTS("$${_bin_SCRIPTS}" $${SALOME_INSTALL_SCRIPT_PYTHON})
 INSTALL(FILES $${_res_files} DESTINATION "$${SALOME_${module}_INSTALL_RES_DATA}")
-QT4_INSTALL_TS_RESOURCES("$${_ts_RESOURCES}" "$${SALOME_${module}_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("$${_ts_RESOURCES}" "$${SALOME_${module}_INSTALL_RES_DATA}")
 """
 cmake_py_gui = Template(cmake_py_gui)
index 8026d93800e313e75f7683bb1abe06fa124030e5..0c00a902cb504fef93084dc201b8eaad8d5b5e07 100644 (file)
@@ -136,9 +136,12 @@ IF(SALOME_GUI_MODULE)
   ## From GUI:
   ##
   FIND_PACKAGE(SalomeCAS REQUIRED)
-  # Qt4
-  FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
-  INCLUDE($${QT_USE_FILE})
+  # Qt4/Qt5
+  IF(NOT SALOME_GUI_BUILD_WITH_QT5)
+    FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
+  ELSE()
+    FIND_PACKAGE(SalomeQt5 REQUIRED)
+  ENDIF()
 ENDIF(SALOME_GUI_MODULE)
 
 ${add_modules}