Salome HOME
projects
/
modules
/
gui.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote branch 'origin/V8_5_asterstudy'
[modules/gui.git]
/
src
/
SalomeApp
/
pluginsdemo
/
tubedialog.py
diff --git
a/src/SalomeApp/pluginsdemo/tubedialog.py
b/src/SalomeApp/pluginsdemo/tubedialog.py
index ddd3fcff7564c94e174e1f95f9bb5a098a49b371..3716205b1f186ef76e357e40dedcbff273795f66 100644
(file)
--- a/
src/SalomeApp/pluginsdemo/tubedialog.py
+++ b/
src/SalomeApp/pluginsdemo/tubedialog.py
@@
-1,4
+1,4
@@
-# Copyright (C) 2010-201
4
CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2010-201
6
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
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@
-19,8
+19,7
@@
# Author : Guillaume Boulant (EDF)
import sys
# Author : Guillaume Boulant (EDF)
import sys
-from PyQt4 import QtGui
-from PyQt4 import QtCore
+from qtsalome import *
from tubedialog_ui import TubeDialog_UI
from tubedialog_ui import TubeDialog_UI
@@
-33,27
+32,27
@@
class TubeDialog(TubeDialog_UI):
def handleAcceptWith(self,callbackFunction):
"""This defines the function to be connected to the signal 'accepted()' (click on Ok)"""
def handleAcceptWith(self,callbackFunction):
"""This defines the function to be connected to the signal 'accepted()' (click on Ok)"""
-
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"),
callbackFunction)
+
self.buttonBox.accepted.connect(
callbackFunction)
def handleRejectWith(self,callbackFunction):
"""This defines the function to be connected to the signal 'rejected()' (click on Cancel)"""
def handleRejectWith(self,callbackFunction):
"""This defines the function to be connected to the signal 'rejected()' (click on Cancel)"""
-
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"),
callbackFunction)
+
self.buttonBox.rejected.connect(
callbackFunction)
def handleApplyWith(self,callbackFunction):
"""This defines the function to be connected to the signal 'apply()' (click on Apply)"""
def handleApplyWith(self,callbackFunction):
"""This defines the function to be connected to the signal 'apply()' (click on Apply)"""
- button = self.buttonBox.button(Q
tGui.QDialogButtonBox.Apply)
-
QtCore.QObject.connect(button, QtCore.SIGNAL("clicked()"),
callbackFunction);
+ button = self.buttonBox.button(Q
DialogButtonBox.Apply)
+
button.clicked.connect(
callbackFunction);
def accept(self):
'''Callback function when dialog is accepted (click Ok)'''
self._wasOk = True
# We should test here the validity of values
def accept(self):
'''Callback function when dialog is accepted (click Ok)'''
self._wasOk = True
# We should test here the validity of values
- Q
tGui.Q
Dialog.accept(self)
+ QDialog.accept(self)
def reject(self):
'''Callback function when dialog is rejected (click Cancel)'''
self._wasOk = False
def reject(self):
'''Callback function when dialog is rejected (click Cancel)'''
self._wasOk = False
- Q
tGui.Q
Dialog.reject(self)
+ QDialog.reject(self)
def wasOk(self):
return self._wasOk
def wasOk(self):
return self._wasOk
@@
-69,7
+68,7
@@
class TubeDialog(TubeDialog_UI):
length=eval(str(self.txtLength.text()))
width=eval(str(self.txtWidth.text()))
except:
length=eval(str(self.txtLength.text()))
width=eval(str(self.txtWidth.text()))
except:
- print
"pb a la saisie"
+ print
("pb a la saisie")
return radius, length, width
return radius, length, width
@@
-83,13
+82,13
@@
class TubeDialogOnTopWithApply(TubeDialog):
"""
TubeDialog.setupUi(self)
# Add a button "Apply"
"""
TubeDialog.setupUi(self)
# Add a button "Apply"
- self.buttonBox.setStandardButtons(Q
tGui.Q
DialogButtonBox.Cancel|
- Q
tGui.Q
DialogButtonBox.Apply|
- Q
tGui.Q
DialogButtonBox.Ok)
+ self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|
+ QDialogButtonBox.Apply|
+ QDialogButtonBox.Ok)
# Keep the dialog on top of the windows
self.setWindowFlags(self.windowFlags() |
# Keep the dialog on top of the windows
self.setWindowFlags(self.windowFlags() |
- Qt
Core.Qt
.WindowStaysOnTopHint)
+ Qt.WindowStaysOnTopHint)
#
#
@@
-104,14
+103,13
@@
def TEST_getData_synchrone():
tubedialog.exec_()
if tubedialog.wasOk():
radius, length, width = tubedialog.getData()
tubedialog.exec_()
if tubedialog.wasOk():
radius, length, width = tubedialog.getData()
- print
radius, length, width
+ print
(radius, length, width)
def main( args ):
def main( args ):
- a = Q
tGui.Q
Application(sys.argv)
+ a = QApplication(sys.argv)
TEST_getData_synchrone()
sys.exit(0)
if __name__=="__main__":
main(sys.argv)
TEST_getData_synchrone()
sys.exit(0)
if __name__=="__main__":
main(sys.argv)
-