Back to index

salome-gui  6.5.0
Public Member Functions | Public Attributes
GUI_PY.mytestdialog.MyTestDialogWithSignals Class Reference
Inheritance diagram for GUI_PY.mytestdialog.MyTestDialogWithSignals:
Inheritance graph
[legend]
Collaboration diagram for GUI_PY.mytestdialog.MyTestDialogWithSignals:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def accept
def setData
def checkData
def getData

Public Attributes

 ui
 checkDataMessage

Detailed Description

This class is to illustrate the usage of the GenericDialog in the
case where the dialog windows is not modal. In such a case, the
controller must be warn of close events using Qt signals.

Definition at line 75 of file mytestdialog.py.


Constructor & Destructor Documentation

def GUI_PY.mytestdialog.MyTestDialogWithSignals.__init__ (   self,
  parent = None,
  name = "MyTestDialogWithSignals" 
)

Reimplemented from GUI_PY.mytestdialog.MyTestDialog.

Definition at line 81 of file mytestdialog.py.

00081 
00082     def __init__(self, parent=None, name="MyTestDialogWithSignals"):
00083         MyTestDialog.__init__(self, parent, name)


Member Function Documentation

This function is the slot connected to the the OK button
(click event of the OK button). 

Definition at line 84 of file mytestdialog.py.

00084 
00085     def accept(self):
00086         """
00087         This function is the slot connected to the the OK button
00088         (click event of the OK button). 
00089         """
00090         # The dialog is raised in a non modal mode (for example, to
00091         # get interactivity with the parents windows. Then we have to
00092         # emit a signal to warn the parent observer that the dialog
00093         # has been validated so that it can process the event
00094         MyTestDialog.accept(self)
00095         if self.wasOk():
00096             self.emit(SIGNAL('inputValidated()'))
00097 
00098 
00099 
00100 #
00101 # ==============================================================================
00102 # Basic use case
00103 # ==============================================================================
00104 #

Here is the call graph for this function:

Here is the caller graph for this function:

def GUI_PY.mytestdialog.MyTestDialog.checkData (   self) [inherited]
This function implements the control to be done on the values contained
in the widgets when trying to validate the dialog window (click OK first
trigs this function).

Definition at line 53 of file mytestdialog.py.

00053 
00054     def checkData(self):
00055         """
00056         This function implements the control to be done on the values contained
00057         in the widgets when trying to validate the dialog window (click OK first
00058         trigs this function).
00059         """
00060         if ( self.ui.txtName.text().trimmed() == "" ):
00061             self.checkDataMessage = "The name can't be void"
00062             return False
00063         return True

def GUI_PY.mytestdialog.MyTestDialog.getData (   self) [inherited]
This function implements the mapping from the widgets to the data model

Definition at line 64 of file mytestdialog.py.

00064 
00065     def getData(self):
00066         """
00067         This function implements the mapping from the widgets to the data model
00068         """
00069         name = str(self.ui.txtName.text().trimmed().toUtf8())
00070         # _MEM_: note here that (i) the utf8 format is used and (ii) we must not
00071         # forget to convert to a standard python string (instead of a QString).
00072         return name
00073 

def GUI_PY.mytestdialog.MyTestDialog.setData (   self,
  name 
) [inherited]
This function implements the mapping from the data model to the widgets

Definition at line 47 of file mytestdialog.py.

00047 
00048     def setData(self, name):
00049         """
00050         This function implements the mapping from the data model to the widgets
00051         """
00052         self.ui.txtName.setText(name)


Member Data Documentation

Definition at line 60 of file mytestdialog.py.

Definition at line 36 of file mytestdialog.py.


The documentation for this class was generated from the following file: