Back to index

salome-gui  6.5.0
Classes | Functions | Variables
GUI_PY.mytestdialog Namespace Reference

Classes

class  MyTestDialog
class  MyTestDialogWithSignals
class  DialogListener

Functions

def TEST_MyTestDialog_modal
def TEST_MyTestDialog_non_modal

Variables

string __author__ = "gboulant"
string __date__ = "$31 mars 2010 17:09:53$"

Function Documentation

Definition at line 105 of file mytestdialog.py.

00105 
00106 def TEST_MyTestDialog_modal():
00107     import sys
00108     from PyQt4.QtCore import QObject, SIGNAL, SLOT
00109     from PyQt4.QtGui import QApplication
00110     app = QApplication(sys.argv)
00111     QObject.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
00112 
00113     dlg=MyTestDialog()
00114     dlg.setData("A default name")
00115     dlg.displayAndWait()
00116     if dlg.wasOk():
00117         name = dlg.getData()
00118         print "The name has been modified to",name
00119 

Definition at line 127 of file mytestdialog.py.

00127 
00128 def TEST_MyTestDialog_non_modal():
00129     import sys
00130     from PyQt4.QtCore import QObject, SIGNAL, SLOT
00131     from PyQt4.QtGui import QApplication
00132     app = QApplication(sys.argv)
00133     QObject.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
00134 
00135     dlg=MyTestDialogWithSignals()
00136     # This dialog window will emit a inputValidated() signal when the
00137     # OK button is pressed and the data are validated. Then, we
00138     # connect this signal to a local slot so that the event can be
00139     # processed.
00140     dlgListener = DialogListener()
00141     app.connect(dlg, SIGNAL('inputValidated()'), dlgListener.onProcessEvent)
00142     # This connect instruction means that the signal inputValidated()
00143     # emited by the dlg Qt object will raise a call to the slot
00144     # dlgListener.onProcessEvent
00145 
00146     dlg.setData("A default name")
00147     dlg.show()
00148 
00149     app.exec_()


Variable Documentation

string GUI_PY.mytestdialog.__author__ = "gboulant"

Definition at line 21 of file mytestdialog.py.

string GUI_PY.mytestdialog.__date__ = "$31 mars 2010 17:09:53$"

Definition at line 22 of file mytestdialog.py.