PyQt4/PyQt5 support.

This commit is contained in:
rnv 2016-01-27 19:00:36 +03:00
parent 6e0a5f1b44
commit 5a07078335
3 changed files with 9 additions and 11 deletions

View File

@ -26,7 +26,7 @@ def t_shape_fluid(context):
from salome.geom.t_shape import t_shape_dialog from salome.geom.t_shape import t_shape_dialog
from salome.geom.t_shape import t_shape_progress from salome.geom.t_shape import t_shape_progress
import xalome import xalome
from PyQt4.QtGui import QMessageBox from qtsalome import QMessageBox
activeStudy = context.study activeStudy = context.study
dialog = t_shape_dialog.TShapeDialog() dialog = t_shape_dialog.TShapeDialog()

View File

@ -20,15 +20,14 @@
# Author : Renaud Nédélec (OpenCascade S.A.S) # Author : Renaud Nédélec (OpenCascade S.A.S)
import sys import sys
from PyQt4 import QtGui from qtsalome import *
from PyQt4 import QtCore
from t_shape_dialog_ui import Ui_Dialog from t_shape_dialog_ui import Ui_Dialog
class TShapeDialog(QtGui.QDialog): class TShapeDialog(QDialog):
def __init__(self): def __init__(self):
QtGui.QDialog.__init__(self, None, QtCore.Qt.Tool) QDialog.__init__(self, None, Qt.Tool)
# Set up the user interface from Designer. # Set up the user interface from Designer.
self.ui = Ui_Dialog() self.ui = Ui_Dialog()
self.ui.setupUi(self) self.ui.setupUi(self)
@ -43,7 +42,7 @@ class TShapeDialog(QtGui.QDialog):
def accept(self): def accept(self):
self._wasOk = True self._wasOk = True
QtGui.QDialog.accept(self) QDialog.accept(self)
def getData(self): def getData(self):
r1 = self.ui.dsb_bigRadius.value() r1 = self.ui.dsb_bigRadius.value()
@ -58,7 +57,7 @@ class TShapeDialog(QtGui.QDialog):
def reject(self): def reject(self):
self._wasOk = False self._wasOk = False
QtGui.QDialog.reject(self) QDialog.reject(self)
def wasOk(self): def wasOk(self):
return self._wasOk return self._wasOk
@ -70,7 +69,7 @@ class TShapeDialog(QtGui.QDialog):
def main( args ): def main( args ):
import sys import sys
app = QtGui.QApplication(sys.argv) app = QApplication(sys.argv)
Dialog = TShapeDialog() Dialog = TShapeDialog()
ui = Ui_Dialog() ui = Ui_Dialog()
ui.setupUi(Dialog) ui.setupUi(Dialog)

View File

@ -20,15 +20,14 @@
# Author : Renaud Nédélec (OpenCascade S.A.S) # Author : Renaud Nédélec (OpenCascade S.A.S)
from salome.geom.t_shape import t_shape_builder from salome.geom.t_shape import t_shape_builder
from PyQt4.QtGui import QProgressDialog from qtsalome import *
from PyQt4 import QtCore
class t_shape_progress(QProgressDialog): class t_shape_progress(QProgressDialog):
_totSteps = 0 _totSteps = 0
_nmaxSteps = 27 _nmaxSteps = 27
def __init__(self, parent=None): def __init__(self, parent=None):
QProgressDialog.__init__(self, "t_shape fluid build", "stop", 0, self._nmaxSteps, parent, QtCore.Qt.Tool) QProgressDialog.__init__(self, "t_shape fluid build", "stop", 0, self._nmaxSteps, parent, Qt.Tool)
self.show() self.show()
def run(self, activeStudy, r1, r2, h1, h2, thickness): def run(self, activeStudy, r1, r2, h1, h2, thickness):