From 90622098883a506ff4f8c2974a568fd361f49a56 Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Tue, 19 Sep 2017 11:47:57 +0200 Subject: [PATCH] Removing QT4 support (following EFICAS), corrections --- src/daEficas/configuration_ADAO.py | 6 +---- .../daEficasWrapper/adaoEficasWrapper.py | 18 +++---------- src/daSalome/daGUI/daGuiImpl/ADAOGUI_impl.py | 11 +++----- src/daSalome/daGUI/daGuiImpl/adaoGuiHelper.py | 9 ++----- .../daGUI/daGuiImpl/adaoGuiManager.py | 16 +++--------- .../daGUI/daGuiImpl/adaoModuleHelper.py | 6 +---- src/daSalome/daGUI/daUtils/Makefile.am | 1 - src/daSalome/daGUI/daUtils/qtversion.py | 26 ------------------- 8 files changed, 14 insertions(+), 79 deletions(-) delete mode 100644 src/daSalome/daGUI/daUtils/qtversion.py diff --git a/src/daEficas/configuration_ADAO.py b/src/daEficas/configuration_ADAO.py index c24669a..7d6862d 100644 --- a/src/daEficas/configuration_ADAO.py +++ b/src/daEficas/configuration_ADAO.py @@ -29,11 +29,7 @@ # print "passage dans la surcharge de configuration pour Adao" import os, sys, string, types, re import traceback -from daUtils.qtversion import useQT5 -if useQT5: - from PyQt5.QtGui import * -else: - from PyQt4.QtGui import * +from PyQt5.QtGui import * # Modules Eficas from InterfaceQT4 import configuration diff --git a/src/daSalome/daGUI/daEficasWrapper/adaoEficasWrapper.py b/src/daSalome/daGUI/daEficasWrapper/adaoEficasWrapper.py index 52bae94..3ae14f1 100644 --- a/src/daSalome/daGUI/daEficasWrapper/adaoEficasWrapper.py +++ b/src/daSalome/daGUI/daEficasWrapper/adaoEficasWrapper.py @@ -26,14 +26,8 @@ import os import eficasSalome # Import from EFICAS_SRC from InterfaceQT4 import qtEficas # Import from Eficas -from daUtils.qtversion import useQT5 -if useQT5: - from PyQt5.QtGui import * # Import from PyQT - from PyQt5.QtCore import * # Import from PyQT -else: - from PyQt4.QtGui import * # Import from PyQT - from PyQt4.QtCore import * # Import from PyQT - # from PyQt5.QtAssistant import * # Import from PyQT +from PyQt5.QtGui import * # Import from PyQT +from PyQt5.QtCore import * # Import from PyQT from daUtils.adaoEficasEvent import * from daUtils.adaoLogger import * @@ -59,14 +53,10 @@ class AdaoEficasWrapper(eficasSalome.MyEficas): import salome ; salome.salome_init() eficasSalome.MyEficas.__init__(self, None, code="ADAO", module="ADAO") - if useQT5: - self.viewmanager.myQtab.currentChanged.connect(self.tabChanged) - else: - self.connect(self.viewmanager.myQtab, SIGNAL('currentChanged(int)'), self.tabChanged) + self.viewmanager.myQtab.currentChanged.connect(self.tabChanged) # self.menubar.hide() # self.toolBar.hide() - # if useQT5: - # self.frameEntete.close() + # self.frameEntete.close() self.closeEntete() def addJdcInSalome(self, jdcPath): diff --git a/src/daSalome/daGUI/daGuiImpl/ADAOGUI_impl.py b/src/daSalome/daGUI/daGuiImpl/ADAOGUI_impl.py index 77d0a0f..1cd951a 100644 --- a/src/daSalome/daGUI/daGuiImpl/ADAOGUI_impl.py +++ b/src/daSalome/daGUI/daGuiImpl/ADAOGUI_impl.py @@ -22,14 +22,9 @@ __author__="aribes/gboulant" -from daUtils.qtversion import useQT5 -if useQT5: - from PyQt5.QtGui import * - from PyQt5.QtCore import * - from PyQt5.QtWidgets import QApplication -else: - from PyQt4.QtGui import * - from PyQt4.QtCore import * +from PyQt5.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtWidgets import QApplication import SalomePyQt sgPyQt = SalomePyQt.SalomePyQt() diff --git a/src/daSalome/daGUI/daGuiImpl/adaoGuiHelper.py b/src/daSalome/daGUI/daGuiImpl/adaoGuiHelper.py index 6a4abf4..76ff31f 100644 --- a/src/daSalome/daGUI/daGuiImpl/adaoGuiHelper.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoGuiHelper.py @@ -28,13 +28,8 @@ import SalomePyQt __sgPyQt = SalomePyQt.SalomePyQt() from . import adaoModuleHelper -from daUtils.qtversion import useQT5 -if useQT5: - from PyQt5 import QtGui, QtCore - from PyQt5.QtWidgets import QApplication, QMessageBox -else: - from PyQt4 import QtGui, QtCore - from PyQt4.QtGui import QApplication, QMessageBox +from PyQt5 import QtGui, QtCore +from PyQt5.QtWidgets import QApplication, QMessageBox def waitCursor(): QtGui.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.WaitCursor)) diff --git a/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py b/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py index 4210c9e..ebebae3 100644 --- a/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py @@ -28,15 +28,8 @@ in the GUI part of the module. __author__ = "aribes/gboulant" import traceback -from daUtils.qtversion import useQT5 -if useQT5: - from PyQt5.QtCore import QObject - from PyQt5.QtWidgets import QScrollArea -else: - from PyQt4.QtCore import QObject - from PyQt4.QtCore import * # Import from PyQT - from PyQt4 import QtCore - from PyQt4.QtGui import QScrollArea +from PyQt5.QtCore import QObject +from PyQt5.QtWidgets import QScrollArea import SalomePyQt sgPyQt = SalomePyQt.SalomePyQt() @@ -121,10 +114,7 @@ class AdaoCaseManager(EficasObserver): # On s'abonne au gestionnaire de selection self.selection_manager = sgPyQt.getSelection() - if useQT5: - self.selection_manager.currentSelectionChanged.connect(self.currentSelectionChanged) - else: - QtCore.QObject.connect(self.selection_manager, QtCore.SIGNAL('currentSelectionChanged()'), self.currentSelectionChanged) + self.selection_manager.currentSelectionChanged.connect(self.currentSelectionChanged) ###### # diff --git a/src/daSalome/daGUI/daGuiImpl/adaoModuleHelper.py b/src/daSalome/daGUI/daGuiImpl/adaoModuleHelper.py index 54a6dbf..97b7caf 100644 --- a/src/daSalome/daGUI/daGuiImpl/adaoModuleHelper.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoModuleHelper.py @@ -79,11 +79,7 @@ def componentName(): # _MEM_ we use here the tr() translation methode to manage constant parameters # in the application. We could have specified instead constant values directly # in the code below. It's a matter of convenience. -from daUtils.qtversion import useQT5 -if useQT5: - from PyQt5.QtCore import QObject -else: - from PyQt4.QtCore import QObject +from PyQt5.QtCore import QObject QObjectTR=QObject() def componentUserName(): diff --git a/src/daSalome/daGUI/daUtils/Makefile.am b/src/daSalome/daGUI/daUtils/Makefile.am index 0428713..4607ba8 100644 --- a/src/daSalome/daGUI/daUtils/Makefile.am +++ b/src/daSalome/daGUI/daUtils/Makefile.am @@ -27,6 +27,5 @@ mypkgpython_PYTHON = \ __init__.py \ adaoEficasEvent.py \ adaoLogger.py \ - qtversion.py \ enumerate.py diff --git a/src/daSalome/daGUI/daUtils/qtversion.py b/src/daSalome/daGUI/daUtils/qtversion.py deleted file mode 100644 index efa1818..0000000 --- a/src/daSalome/daGUI/daUtils/qtversion.py +++ /dev/null @@ -1,26 +0,0 @@ -#-*- coding: utf-8 -*- -# -# Copyright (C) 2008-2017 EDF R&D -# -# 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. -# -# 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: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D - -import eficasSalome # Import from EFICAS_SRC -from InterfaceQT4.determine import monEnvQT5 - -useQT5 = bool(monEnvQT5) -- 2.39.2