]> SALOME platform Git repositories - modules/hydrosolver.git/commitdiff
Salome HOME
porting to PyQt5
authorasl <asl@opencascade.com>
Mon, 23 Jan 2017 12:09:14 +0000 (15:09 +0300)
committerasl <asl@opencascade.com>
Mon, 23 Jan 2017 12:09:14 +0000 (15:09 +0300)
12 files changed:
CMakeLists.txt
src/HYDROGUI/BndConditionsDialog.py
src/HYDROGUI/HYDROSOLVERGUI.py [changed mode: 0644->0755]
src/salome_hydro/coupling1d2d/eficas/appli.py
src/salome_hydro/gui_utils.py
src/salome_hydro/interpolz_gui.py
src/salome_hydro/mascaret/eficas/appli.py
src/salome_hydro/pytel/CMakeLists.txt
src/salome_hydro/pytel/eficas/appli.py
src/salome_hydro/pytel/genjobwindow.py
src/salome_hydro/telemac2d/eficas/appli.py
tests/boundaryConditionsDlgTest.py

index 23fbc6e2c00865529725c9fae27bae9d9d20ebf1..0936733fa2180a1a8723d7fc3697ef8b8f637dc2 100644 (file)
@@ -34,10 +34,18 @@ SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
 
 # Find KERNEL
 # ===========
+SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
+IF(EXISTS ${CONFIGURATION_ROOT_DIR})
+  LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
+  INCLUDE(SalomeMacros)
+ELSE()
+  MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
+ENDIF()
+
 SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
 IF(EXISTS ${KERNEL_ROOT_DIR})
   LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
-  INCLUDE(SalomeMacros)
+  #INCLUDE(SalomeMacros)
   FIND_PACKAGE(SalomeKERNEL REQUIRED)
 ELSE(EXISTS ${KERNEL_ROOT_DIR})
   MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR")
@@ -94,7 +102,7 @@ ENDIF(EXISTS ${GUI_ROOT_DIR})
 ##
 ## From GUI:
 ##
-FIND_PACKAGE(SalomePyQt4 REQUIRED) 
+FIND_PACKAGE(SalomePyQt5 REQUIRED) 
 
 ##
 ## HYDROSOLVER specifics
index 5156d8460bb0902e5cbc2b599a37460f625652c1..21f109b893752ecebc9a867f6273ed1b894a1833 100644 (file)
 import os
 import sys
 
-from PyQt4 import QtCore, QtGui, uic
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
+from PyQt5.QtWidgets import *
+from PyQt5 import uic
 
 from MEDLoader import MEDFileMesh
 
@@ -70,15 +73,15 @@ def get_int(str):
     return value
 
 """Item delegate for LIHBOR, LIUBOR, LIVBOR and LITBOR columns"""    
-class ValueDelegate(QtGui.QStyledItemDelegate):
+class ValueDelegate(QStyledItemDelegate):
     
     def __init__(self, parent = None):
-        QtGui.QStyledItemDelegate.__init__(self, parent)
+        QStyledItemDelegate.__init__(self, parent)
         
     def createEditor(self, parent, option, index):
-        line_edit = QtGui.QLineEdit(parent)
+        line_edit = QLineEdit(parent)
         
-        validator = QtGui.QIntValidator(parent)
+        validator = QIntValidator(parent)
         validator.setRange(0, 6)
         
         line_edit.setValidator(validator)
@@ -86,7 +89,7 @@ class ValueDelegate(QtGui.QStyledItemDelegate):
         return line_edit
         
     def setEditorData(self, editor, index):
-        value, is_ok = index.model().data(index, QtCore.Qt.EditRole).toInt()
+        value, is_ok = index.model().data(index, Qt.EditRole).toInt()
 
         if is_ok:
             editor.setText(str(value))
@@ -94,16 +97,16 @@ class ValueDelegate(QtGui.QStyledItemDelegate):
             editor.setText('')
     
     def setModelData(self, editor, model, index):
-        model.setData(index, editor.text(), QtCore.Qt.EditRole)
+        model.setData(index, editor.text(), Qt.EditRole)
 
     def updateEditorGeometry(self, editor, option, index):
         editor.setGeometry(option.rect)
     
 """Boundary conditions definition dialog"""    
-class BoundaryConditionsDialog(QtGui.QDialog):
+class BoundaryConditionsDialog(QDialog):
 
     def __init__(self, parent = None, modal = 0):
-        QtGui.QDialog.__init__(self, parent)
+        QDialog.__init__(self, parent)
         uic.loadUi(os.path.join(hydro_solver_root, 'BndConditionsDialog.ui'), self )
                                                        
         # Connections
@@ -174,7 +177,7 @@ class BoundaryConditionsDialog(QtGui.QDialog):
         preset_name = get_preset_name(self.presets, lihbor, liubor, livbor, litbor)
         
         combo = self.boundaryConditionsTable.cellWidget(row, 0)
-        if isinstance(combo, QtGui.QComboBox):
+        if isinstance(combo, QComboBox):
             ind = combo.findText(preset_name)
             if ind >= 0:
                 combo.setCurrentIndex(ind)
@@ -209,7 +212,7 @@ class BoundaryConditionsDialog(QtGui.QDialog):
     """Select MED file"""
     def on_med_file_browse(self):
         # Get file path
-        file_path = QtGui.QFileDialog.getOpenFileName(self, self.tr("Open MED file"), "", self.tr("MED files (*.med)"))
+        file_path = QFileDialog.getOpenFileName(self, self.tr("Open MED file"), "", self.tr("MED files (*.med)"))
         if not file_path:
             return
         
@@ -223,11 +226,11 @@ class BoundaryConditionsDialog(QtGui.QDialog):
             # Update table
             self.set_groups(groups)
         else:
-            QtGui.QMessageBox.warning(self, self.tr("Warning"), self.tr("Can't get group names from the selected MED file."))
+            QMessageBox.warning(self, self.tr("Warning"), self.tr("Can't get group names from the selected MED file."))
     
     """Select boundary conditions file"""
     def on_bnd_file_browse(self):
-        file_path = QtGui.QFileDialog.getOpenFileName(self, self.tr("Open boundary conditions file"))
+        file_path = QFileDialog.getOpenFileName(self, self.tr("Open boundary conditions file"))
         
         if file_path:
             self.bndConditionsFileEdit.setText(file_path)
@@ -242,12 +245,12 @@ class BoundaryConditionsDialog(QtGui.QDialog):
             read_errors = reader.errors
             if len( read_errors ) > 0:
                 msg = "\n".join(read_errors)
-                QtGui.QMessageBox.warning(self, self.tr("Warning"), msg)
+                QMessageBox.warning(self, self.tr("Warning"), msg)
             
             if len(self.input_conditions) > 0:
                 self.update_table()
             else:
-                QtGui.QMessageBox.warning(self, self.tr("Warning"), self.tr("No conditions have been read from the file."))
+                QMessageBox.warning(self, self.tr("Warning"), self.tr("No conditions have been read from the file."))
     
     """Called on preset selection in the first column of the table"""
     def on_preset_changed(self):
@@ -279,7 +282,7 @@ class BoundaryConditionsDialog(QtGui.QDialog):
         
     """Define result file path"""
     def on_result_file_browse(self):
-        file_path = QtGui.QFileDialog.getSaveFileName(self, self.tr("Select output file path"))
+        file_path = QFileDialog.getSaveFileName(self, self.tr("Select output file path"))
         if file_path:
             self.resultBndConditionsFileEdit.setText(file_path)
     
@@ -292,7 +295,7 @@ class BoundaryConditionsDialog(QtGui.QDialog):
             self.boundaryConditionsTable.insertRow(row_nb)
             
             # 'Preset' column
-            combo = QtGui.QComboBox(self)
+            combo = QComboBox(self)
             combo.addItem('')
             if len(self.presets) > 0:
                 combo.addItems(self.presets.keys())
@@ -304,23 +307,23 @@ class BoundaryConditionsDialog(QtGui.QDialog):
             self.boundaryConditionsTable.setCellWidget(row_nb, 0, combo)
             
             # 'LIHBOR' column
-            self.boundaryConditionsTable.setItem(row_nb, 1, QtGui.QTableWidgetItem(''))
+            self.boundaryConditionsTable.setItem(row_nb, 1, QTableWidgetItem(''))
             
             # 'LIUBOR' column
-            self.boundaryConditionsTable.setItem(row_nb, 2, QtGui.QTableWidgetItem(''))
+            self.boundaryConditionsTable.setItem(row_nb, 2, QTableWidgetItem(''))
             
             # 'LIVBOR' column
-            self.boundaryConditionsTable.setItem(row_nb, 3, QtGui.QTableWidgetItem(''))
+            self.boundaryConditionsTable.setItem(row_nb, 3, QTableWidgetItem(''))
             
             # 'LITBOR' column
-            self.boundaryConditionsTable.setItem(row_nb, 4, QtGui.QTableWidgetItem(''))
+            self.boundaryConditionsTable.setItem(row_nb, 4, QTableWidgetItem(''))
             
             # 'Group' column
-            item = QtGui.QTableWidgetItem(group)
+            item = QTableWidgetItem(group)
             font = item.font()
             font.setBold(True)
             item.setFont(font)
-            item.setFlags(QtCore.Qt.ItemIsEnabled)
+            item.setFlags(Qt.ItemIsEnabled)
             self.boundaryConditionsTable.setItem(row_nb, 5, item)
         
         self.update_table()
@@ -348,7 +351,7 @@ class BoundaryConditionsDialog(QtGui.QDialog):
                 is_updated = True
                 
         if not is_updated and nb_rows > 0 and len(self.input_conditions) > 0:
-            QtGui.QMessageBox.information(self, self.tr("Information"), self.tr("No one group name from the MED file is presented in the input list of conditions."))
+            QMessageBox.information(self, self.tr("Information"), self.tr("No one group name from the MED file is presented in the input list of conditions."))
     
     """Get output file path"""
     def get_output_path(self):
@@ -364,9 +367,9 @@ class BoundaryConditionsDialog(QtGui.QDialog):
         is_ok = False
     
         if self.boundaryConditionsTable.rowCount() < 1:
-            QtGui.QMessageBox.critical(self, self.tr("Insufficient input data"), self.tr("Boundary conditions list is empty."))
+            QMessageBox.critical(self, self.tr("Insufficient input data"), self.tr("Boundary conditions list is empty."))
         elif self.get_output_path().isEmpty():
-            QtGui.QMessageBox.critical(self, self.tr("Insufficient input data"), self.tr("Output file path is empty."))
+            QMessageBox.critical(self, self.tr("Insufficient input data"), self.tr("Output file path is empty."))
         else:
             has_empty_cells = False
             for row_nb in xrange(0, self.boundaryConditionsTable.rowCount()):
@@ -380,7 +383,7 @@ class BoundaryConditionsDialog(QtGui.QDialog):
                     break
             
             if has_empty_cells:
-                QtGui.QMessageBox.critical(self, self.tr("Insufficient input data"), self.tr("Table has empty cell(s)."))
+                QMessageBox.critical(self, self.tr("Insufficient input data"), self.tr("Table has empty cell(s)."))
             else:
                 is_ok = True
             
@@ -419,5 +422,5 @@ class BoundaryConditionsDialog(QtGui.QDialog):
         to perform the data export to the file.
         Click on "Close" button does not lead to saving the data and just closes the dialog.
         """
-        QtGui.QMessageBox.about(self, self.tr("About boundary conditions dialog"), msg);
+        QMessageBox.about(self, self.tr("About boundary conditions dialog"), msg);
         pass
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
index 133e55c..bb74eb6
@@ -20,7 +20,9 @@ import os
 import traceback
 import logging
 
-from PyQt4 import QtCore, QtGui
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
+from PyQt5.QtWidgets import *
 
 import salome
 import SALOME
@@ -36,11 +38,11 @@ import HYDROSOLVER_ORB
 from salome.hydro.interpolz_gui import InterpolzDlg
 from salome.hydro.gui_utils import HSGUIException, wait_cursor, get_and_check_selected_file_path
 import salome.hydro.study as hydro_study
-from salome.hydro.mascaret.eficas.appli import EficasForMascaretAppli
-from salome.hydro.telemac2d.eficas.appli import EficasForTelemac2DAppli
-from salome.hydro.coupling1d2d.eficas.appli import EficasForCoupling1D2DAppli
-import salome.hydro.pytel.gui as pytel_gui
-from salome.hydro.boundary_conditions.eficas.appli import EficasForBoundaryConditionsAppli
+#from salome.hydro.mascaret.eficas.appli import EficasForMascaretAppli
+#from salome.hydro.telemac2d.eficas.appli import EficasForTelemac2DAppli
+#from salome.hydro.coupling1d2d.eficas.appli import EficasForCoupling1D2DAppli
+#import salome.hydro.pytel.gui as pytel_gui
+#from salome.hydro.boundary_conditions.eficas.appli import EficasForBoundaryConditionsAppli
 
 import BndConditionsDialog
 
@@ -282,17 +284,17 @@ def OnGUIEvent( commandID ):
     try:
         dict_command[commandID]()
     except HSGUIException, exc:
-        QtGui.QMessageBox.critical(sgPyQt.getDesktop(),
-                                   QtGui.QApplication.translate("OnGUIEvent", "Error"),
+        QMessageBox.critical(sgPyQt.getDesktop(),
+                                   QApplication.translate("OnGUIEvent", "Error"),
                                    unicode(exc))
     except:
         logger.exception("Unhandled exception caught in HYDROSOLVER GUI")
-        msg = QtGui.QApplication.translate("OnGUIEvent",
+        msg = QApplication.translate("OnGUIEvent",
             "Unhandled error happened in HYDROSOLVER module. Please report a bug on "
             '<a href="https://forge-pleiade.der.edf.fr/projects/salome-rex/issues">SALOME bugtracker</a>, '
             'category "HYDROSOLVER", describing how you got there and including the following traceback:')
-        msgBox = QtGui.QMessageBox(QtGui.QMessageBox.Critical,
-                                   QtGui.QApplication.translate("OnGUIEvent", "Error"),
+        msgBox = QMessageBox(QMessageBox.Critical,
+                                   QApplication.translate("OnGUIEvent", "Error"),
                                    msg,
                                    parent = sgPyQt.getDesktop())
         msgBox.setDetailedText(traceback.format_exc())
@@ -308,13 +310,13 @@ def OnGUIEvent( commandID ):
 """
 from TextDisplayDialog import Ui_TextDisplayDialog
 
-class MyTextDisplayDialog(Ui_TextDisplayDialog, QtGui.QDialog):
+class MyTextDisplayDialog(Ui_TextDisplayDialog, QDialog):
 
     def __init__(self, parent = None, modal = 0):
-        QtGui.QDialog.__init__(self, parent)
+        QDialog.__init__(self, parent)
         Ui_TextDisplayDialog.__init__(self)
         self.setupUi(self)
-        self.connect(self.closeButton, QtCore.SIGNAL("clicked()"), self.close)
+        self.connect(self.closeButton, SIGNAL("clicked()"), self.close)
     
     def set_log(self, log):
         self.contentTextEdit.setPlainText(log)
@@ -350,7 +352,7 @@ def run_mascaret():
             salome.sg.updateObjBrowser( 0 )
     except SALOME.SALOME_Exception, exc:
         salome.sg.updateObjBrowser( 0 )
-        msg = unicode(QtGui.QApplication.translate("run_mascaret",
+        msg = unicode(QApplication.translate("run_mascaret",
                       "An error happened while trying to run Mascaret:"))
         msg += "\n" + exc.details.text
         raise HSGUIException(msg)
@@ -393,7 +395,7 @@ def run_telemac2d():
     except SALOME.SALOME_Exception, exc:
         if engine is not None:
             engine.GetContainerRef().Shutdown()
-        msg = unicode(QtGui.QApplication.translate("run_telemac2d",
+        msg = unicode(QApplication.translate("run_telemac2d",
                       "An error happened while trying to run Telemac2D:"))
         msg += "\n" + exc.details.text
         raise HSGUIException(msg)
@@ -403,7 +405,7 @@ def run_telemac2d():
             engine.GetContainerRef().Shutdown()
         except:
             pass
-        msg = unicode(QtGui.QApplication.translate("run_telemac2d",
+        msg = unicode(QApplication.translate("run_telemac2d",
                       "An error happened in the computation (Telemac2D probably crashed, "
                       "see logs and listing files for more details):"))
         msg += "\n" + unicode(exc)
@@ -428,7 +430,7 @@ def open_schema_in_yacs():
     if filename.endswith(".comm"):
         filename = filename[:-5] + ".xml"
     if not os.path.isfile(filename):
-        raise HSGUIException(QtGui.QApplication.translate("open_schema_in_yacs",
+        raise HSGUIException(QApplication.translate("open_schema_in_yacs",
                                   "Schema file %1 does not exist").arg(filename))
     yg = salome.ImportComponentGUI("YACS")
     yg.loadSchema(filename)
index 30843c479da7b16adcf082887559072788968655..9d379dd4dffff36edd88aebdbf6c4637b4fc036b 100644 (file)
@@ -21,7 +21,8 @@ import os
 import sys
 import re
 
-from PyQt4.QtGui import QMessageBox
+from PyQt5.QtGui import *
+from PyQt5.QtWidgets import *
 
 import salome
 import SalomePyQt
index 0463e04073890398eb3d74dfdb08cb9c806119c2..cc080aab08fb4e1250aded43617fefdf9d8f17b9 100644 (file)
@@ -16,7 +16,9 @@
 #  along with SALOME HYDRO module.  If not, see <http://www.gnu.org/licenses/>.
 
 import os
-from PyQt4 import QtCore, QtGui
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
+from PyQt5.QtWidgets import *
 
 import salome
 from salome.kernel.studyedit import getStudyEditor
@@ -39,12 +41,12 @@ class OverrideCursorCM:
     self.cursor = cursor
   
   def __enter__(self):
-    QtGui.QApplication.setOverrideCursor(self.cursor)
+    QApplication.setOverrideCursor(self.cursor)
   
   def __exit__(self, exc_type, exc_value, traceback):
-    QtGui.QApplication.restoreOverrideCursor()
+    QApplication.restoreOverrideCursor()
 
-wait_cursor = OverrideCursorCM(QtGui.QCursor(QtCore.Qt.WaitCursor))
+wait_cursor = OverrideCursorCM(QCursor(Qt.WaitCursor))
 
 
 def get_and_check_selected_file_path():
@@ -56,6 +58,6 @@ def get_and_check_selected_file_path():
   sobj = ed.study.FindObjectID(salome.sg.getSelected(0))
   filepath = sobj.GetComment()
   if not os.path.isfile(filepath):
-    raise HSGUIException(QtGui.QApplication.translate("get_and_check_selected_file_path",
+    raise HSGUIException(QApplication.translate("get_and_check_selected_file_path",
                                                       "File %1 does not exist").arg(filepath))
   return filepath
index c15d84d672a6cc053c65c8c7b404b7d84515f606..86720120ffc0e067681f64d75bea55014de4a71c 100644 (file)
@@ -10,7 +10,10 @@ salome.salome_init()
 import MEDLoader
 import HYDROPy
 
-from PyQt4 import QtCore, QtGui, uic
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
+from PyQt5.QtWidgets import *
+from PyQt5 import uic
 
 import SalomePyQt
 import libSALOME_Swig
@@ -65,24 +68,24 @@ def get_selected_calc_case():
                 return name
     return None
     
-class InterpolzDlg( QtGui.QDialog ):
+class InterpolzDlg( QDialog ):
     def __init__(self, parent = None):
-        QtGui.QDialog.__init__( self, parent )
+        QDialog.__init__( self, parent )
         p = hydro_solver_root
         uic.loadUi( p+'/interpolz.ui', self )
         self.setWindowTitle( 'Generate interpolz script' )
-        self.connect( SalomePyQt.SalomePyQt.getObjectBrowser(), QtCore.SIGNAL("selectionChanged()"), self.onSelectionChanged )
-        self.connect( self.btnOutputPath, QtCore.SIGNAL( "clicked()" ), self.onOutputFile )
-        self.connect( self.btnMEDFile, QtCore.SIGNAL( "clicked()" ), self.onMEDFile )
-        self.connect( self.CalcCase, QtCore.SIGNAL( "textChanged( const QString& )" ), self.onCalcCaseChanged )
-        self.connect( self.MEDFile, QtCore.SIGNAL( "textChanged( const QString& )" ), self.onMEDChanged )
+        self.connect( SalomePyQt.SalomePyQt.getObjectBrowser(), SIGNAL("selectionChanged()"), self.onSelectionChanged )
+        self.connect( self.btnOutputPath, SIGNAL( "clicked()" ), self.onOutputFile )
+        self.connect( self.btnMEDFile, SIGNAL( "clicked()" ), self.onMEDFile )
+        self.connect( self.CalcCase, SIGNAL( "textChanged( const QString& )" ), self.onCalcCaseChanged )
+        self.connect( self.MEDFile, SIGNAL( "textChanged( const QString& )" ), self.onMEDChanged )
         self.UndefZ.setRange( -100000, 100000 )
         self.UndefZ.setValue( -9999 )
         self.InterpMethod.addItem( "Interpolation at the nearest point" )
-        self.connect( self.ApplyClose, QtCore.SIGNAL( "clicked()" ), self.onApplyClose )
-        self.connect( self.Apply, QtCore.SIGNAL( "clicked()" ), self.onApply )
-        self.connect( self.Close, QtCore.SIGNAL( "clicked()" ), self.onClose )
-        self.connect( self.Help, QtCore.SIGNAL( "clicked()" ), self.onHelp )
+        self.connect( self.ApplyClose, SIGNAL( "clicked()" ), self.onApplyClose )
+        self.connect( self.Apply, SIGNAL( "clicked()" ), self.onApply )
+        self.connect( self.Close, SIGNAL( "clicked()" ), self.onClose )
+        self.connect( self.Help, SIGNAL( "clicked()" ), self.onHelp )
          
     def onSelectionChanged( self ):
         calc_case_name = get_selected_calc_case()
@@ -92,14 +95,14 @@ class InterpolzDlg( QtGui.QDialog ):
     def onOutputFile( self ):
       caption = "Python file"
       mask = "*.py"
-      f = QtGui.QFileDialog.getSaveFileName( self, caption, ".", mask )
+      f = QFileDialog.getSaveFileName( self, caption, ".", mask )
       if f!=None and f!="":
         self.OutputPath.setText( f )
       
     def onMEDFile( self ):
       caption = "MED file"
       mask = "*.med"
-      f = QtGui.QFileDialog.getOpenFileName( self, caption, ".", mask )
+      f = QFileDialog.getOpenFileName( self, caption, ".", mask )
       if f!=None and f!="":
         self.MEDFile.setText( f )
         
@@ -114,11 +117,11 @@ class InterpolzDlg( QtGui.QDialog ):
       self.Groups.setRowCount( n )
       for i in range( 0, n ):
         if self.Groups.item( i, 0 ) is None:
-          self.Groups.setItem( i, 0, QtGui.QTableWidgetItem() )
-          self.Groups.setItem( i, 1, QtGui.QTableWidgetItem() )
+          self.Groups.setItem( i, 0, QTableWidgetItem() )
+          self.Groups.setItem( i, 1, QTableWidgetItem() )
         self.Groups.item( i, 0 ).setText( self.med_groups[i] )
         
-        cb = QtGui.QComboBox( self.Groups )
+        cb = QComboBox( self.Groups )
         for r in self.regions:
           cb.addItem( r )
         self.Groups.setCellWidget( i, 1, cb )
@@ -158,7 +161,7 @@ class InterpolzDlg( QtGui.QDialog ):
             msg = "InterpolZ script is successfully generated"
             result = True
             
-        QtGui.QMessageBox.information( self, "", msg )
+        QMessageBox.information( self, "", msg )
         return result
         
     def onClose( self ):
@@ -191,7 +194,7 @@ class InterpolzDlg( QtGui.QDialog ):
 
         When the data is input, the user clicks on "Apply" or "Apply and Close" button to perform the script generation.
         """
-        QtGui.QMessageBox.about(self, self.tr("About boundary conditions dialog"), msg);
+        QMessageBox.about(self, self.tr("About boundary conditions dialog"), msg);
 
 
 if __name__=='__main__':
index 126a184b214dd21ea24bb2e53b959fab02d22efa..b5fe0841829ac324d8e25e32a39e4a69cca50866 100644 (file)
@@ -21,7 +21,9 @@ import os
 import sys
 import re
 
-from PyQt4.QtGui import QMessageBox
+from PyQt5.QtGui import *
+from PyQt5.QtWidgets import *
+
 
 import salome
 import SalomePyQt
index ca9b36c054449d1d5aa05b0341c76689d06bc68c..0620de64f5918632a79be0831fbd036fae6c0ea7 100644 (file)
@@ -17,7 +17,7 @@
 
 ADD_SUBDIRECTORY(eficas)
 
-INCLUDE(UsePyQt4)
+INCLUDE(UsePyQt5)
 
 # --- Python files ---
 
index 6963549c5a049c49f4fa274dba1907fa5528f613..35f669592ac3a49b5d7c4f72701a2556661221b9 100644 (file)
@@ -18,7 +18,9 @@
 import os
 import sys
 
-from PyQt4.QtGui import QMessageBox
+from PyQt5.QtGui import *
+from PyQt5.QtWidgets import *
+
 
 import salome
 import SalomePyQt
index 5ea6df3d118c2fec899513029d51d919d8d3e419..df7df10fe74952c47c824f241580a0605a9193d4 100644 (file)
@@ -16,7 +16,9 @@
 #  along with SALOME HYDRO module.  If not, see <http://www.gnu.org/licenses/>.
 
 import os
-from PyQt4 import QtGui, QtCore
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
+from PyQt5.QtWidgets import *
 
 import salome
 from salome.hydro.pytel.genjob import generate_job
@@ -28,10 +30,10 @@ class GenJobDialog(QtGui.QDialog, Ui_GenJobDialog):
   def __init__(self, parent, pytel_params):
     QtGui.QDialog.__init__(self, parent)
     self.setupUi(self)
-    self.connect(self.dialogButtonBox, QtCore.SIGNAL("accepted()"), self.validate)
-    self.connect(self.dialogButtonBox, QtCore.SIGNAL("rejected()"), self.close)
-    self.connect(self.chooseInputDataDirectoryButton, QtCore.SIGNAL("clicked()"), self.choose_input_dir)
-    self.connect(self.chooseResultDirectoryButton, QtCore.SIGNAL("clicked()"), self.choose_result_dir)
+    self.connect(self.dialogButtonBox, SIGNAL("accepted()"), self.validate)
+    self.connect(self.dialogButtonBox, SIGNAL("rejected()"), self.close)
+    self.connect(self.chooseInputDataDirectoryButton, SIGNAL("clicked()"), self.choose_input_dir)
+    self.connect(self.chooseResultDirectoryButton, SIGNAL("clicked()"), self.choose_result_dir)
     self.telemacRootDirLE.setText("/home/projets-bgq/systel/V6P2")
     self.telemacEnvFileLE.setText("/home/projets-bgq/systel/V6P2/config/pysource.zumbrota.xlf14.sh")
     casedir = os.path.dirname(pytel_params["FICHIER_CAS"])
@@ -47,16 +49,16 @@ class GenJobDialog(QtGui.QDialog, Ui_GenJobDialog):
     self.pytel_params = pytel_params
 
   def choose_input_dir(self):
-    directory = QtGui.QFileDialog.getExistingDirectory(self,
+    directory = QFileDialog.getExistingDirectory(self,
             directory = self.inputDataDirectoryLE.text(),
-            options = QtGui.QFileDialog.ShowDirsOnly)
+            options = QFileDialog.ShowDirsOnly)
     if not directory.isNull():
       self.inputDataDirectoryLE.setText(directory)
 
   def choose_result_dir(self):
-    directory = QtGui.QFileDialog.getExistingDirectory(self,
+    directory = QFileDialog.getExistingDirectory(self,
             directory = self.resultDirectoryLE.text(),
-            options = QtGui.QFileDialog.ShowDirsOnly)
+            options = QFileDialog.ShowDirsOnly)
     if not directory.isNull():
       self.resultDirectoryLE.setText(directory)
 
index 0684bf7834c605967d68bbdb429dc6dbe1b9f1cf..0df10c2360fdf73c0e5dac838e7098dc633f31ac 100644 (file)
@@ -21,7 +21,9 @@ import os
 import sys
 import re
 
-from PyQt4.QtGui import QMessageBox
+from PyQt5.QtGui import *
+from PyQt5.QtWidgets import *
+
 
 import salome
 import SalomePyQt
index b38b0c07ba5bb815ebad9fc57dbf75828626ce13..05a6dcde1aeff18d2bfb152727c16ed034233ef0 100644 (file)
@@ -1,7 +1,8 @@
 import os
 import sys
 
-from PyQt4 import QtGui
+from PyQt5.QtGui import *
+from PyQt5.QtWidgets import *
 
 cur_dir = os.path.dirname(os.path.realpath(__file__))
 data_dir = os.path.join(cur_dir, "data")
@@ -11,7 +12,7 @@ sys.path.append(hydro_solver_root)
 from BndConditionsDialog import BoundaryConditionsDialog
 
 # Show the dialog
-app = QtGui.QApplication(sys.argv)
+app = QApplication(sys.argv)
 window = BoundaryConditionsDialog()
 
 window.show()