Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

GUIbridge Class Reference

Class for providing a bridge between the GUI thread and other threads. More...

List of all members.

Public Member Functions

 __init__ (guiThread)
 This is the constructor of the GUIbridge class.
 shutdown ()
 This method is used to shut the GUI bridge down.
 isGUIthread ()
 Returns True if this method is being called from the GUI thread.
 createGUI (qObject, obj, args, kwargs)
 Method used for instantiating a GUI from a non-GUI thread.
 execGUImethodNR (qObject, func, args, kwargs)
 Method used for executing a GUI function from a non-GUI thread.
 execGUImethod (qObject, func, args, kwargs)
 Method used for executing a GUI function from a non-GUI thread.
 execGUImethod2 (qObject, func, args, kwargs)
 handleCustomEvent (e)


Detailed Description

Class for providing a bridge between the GUI thread and other threads.

This bridge is needed whenever a non-GUI thread needs to interact with the GUI. The GUI is handled by the 'GUI thread'. A 'GUI thread' is defined to be the one in which the Qt QApplication class's exec_loop() method is executed. There can be only one GUI thread in a program.

The solution to the problem is handled by sending a message (an 'event', in Qt terms) from the non-GUI thread to the GUI thread. The message contains information on how it is to be handled. In some cases, this handling produces a result that must be sent back to the initiating non-GUI thread. The requests and responses are passed around via queues. Separate queues are maintained for the different non-GUI threads so that responses don't end up handed off to the wrong thread.

Definition at line 28 of file guiBridges.py.


Member Function Documentation

__init__ guiThread   ) 
 

This is the constructor of the GUIbridge class.

It must be called from the GUI thread.

createGUI qObject  ,
obj  ,
args  ,
kwargs 
 

Method used for instantiating a GUI from a non-GUI thread.

Parameters:
qObject - The Qt object that will receive the customEvent callback
obj - The GUI object class type to create
args - Arguments for the object class constructor
kwargs - Keyword arguments for the object class constructor
Returns:
An instance of the requested GUI object class

execGUImethod qObject  ,
func  ,
args  ,
kwargs 
 

Method used for executing a GUI function from a non-GUI thread.

Use this method when a response is expected from the function and when it is appropriate to wait for it (no deadlock arises)

Parameters:
qObject - The Qt object that will receive the customEvent callback
func - The GUI function or method to call
args - Arguments for the function or method
kwargs - Keyword arguments for the function or method
Returns:
The called GUI function's return value

execGUImethodNR qObject  ,
func  ,
args  ,
kwargs 
 

Method used for executing a GUI function from a non-GUI thread.

Use this method when no (useful) response is expected or when waiting for one could cause a deadlock. Any response from the function is lost.

Parameters:
qObject - The Qt object that will receive the customEvent callback
func - The GUI function or method to call
args - Arguments for the function or method
kwargs - Keyword arguments for the function or method


The documentation for this class was generated from the following file:
Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3