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) |
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.
|
This is the constructor of the GUIbridge class. It must be called from the GUI thread. |
|
Method used for instantiating a GUI from a non-GUI thread.
|
|
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)
|
|
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.
|