Package Camelot :: Package camelot :: Package view :: Package model_thread :: Module signal_slot_model_thread :: Class SignalSlotModelThread |
[frames] | no frames]

# Class SignalSlotModelThread

source code

A model thread implementation that uses signals and slots to communicate between the model thread and the gui thread

there is no explicit model thread verification on these methods, since this model thread might not be THE model thread.

Nested Classes
Inherited from `PyQt4.QtCore.QThread`: `Priority`

Instance Methods
__init__(self, setup_thread=<function setup_model at 0x95a4224>) @param setup_thread: function to be called at startup of the thread to initialize everything, by default this will setup the model. set to None if nothing should be done. | source code
run(self) | source code
post(self, *args, **kwargs) Post a request to the model thread, request should be a function that takes no arguments. The request function will be called within the model thread. When the request is finished, on first occasion, the response function will be called within the gui thread. The response function takes as arguments, the results of the request function. @param request: function to be called within the model thread @param response: a slot that will be called with the result of the request function @param exception: a slot that will be called in case request throws an exception | source code
pop(self, *args, **kwargs) Pop a task from the queue, return None if the queue is empty | source code
busy(self, *args, **kwargs) Return True or False indicating wether either the model or the gui thread is doing something | source code
wait_on_work(*args, **kwargs) Wait for all work to be finished, this function should only be used to do unit testing and such, since it will block the calling thread until all work is done | source code
Inherited from `PyQt4.QtCore.QThread`: `currentThread`, `currentThreadId`, `exec_`, `exit`, `finished`, `idealThreadCount`, `isFinished`, `isRunning`, `msleep`, `priority`, `quit`, `setPriority`, `setStackSize`, `setTerminationEnabled`, `sleep`, `stackSize`, `start`, `started`, `terminate`, `terminated`, `usleep`, `wait`, `yieldCurrentThread` Inherited from `PyQt4.QtCore.QObject`: `blockSignals`, `childEvent`, `children`, `connect`, `connectNotify`, `customEvent`, `deleteLater`, `destroyed`, `disconnect`, `disconnectNotify`, `dumpObjectInfo`, `dumpObjectTree`, `dynamicPropertyNames`, `emit`, `event`, `eventFilter`, `findChild`, `findChildren`, `inherits`, `installEventFilter`, `isWidgetType`, `killTimer`, `metaObject`, `moveToThread`, `objectName`, `parent`, `property`, `pyqtConfigure`, `receivers`, `removeEventFilter`, `sender`, `setObjectName`, `setParent`, `setProperty`, `signalsBlocked`, `startTimer`, `thread`, `timerEvent`, `tr`, `trUtf8` Inherited from `sip.simplewrapper`: `__delattr__`, `__getattribute__`, `__new__`, `__setattr__` Inherited from `camelot.view.model_thread.AbstractModelThread`: `traceback` Inherited from `object`: `__format__`, `__hash__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables
| task_available = ``'``2task_available``'``
Inherited from `PyQt4.QtCore.QThread`: `HighPriority`, `HighestPriority`, `IdlePriority`, `InheritPriority`, `LowPriority`, `LowestPriority`, `NormalPriority`, `TimeCriticalPriority` Inherited from `PyQt4.QtCore.QObject`: `staticMetaObject` Inherited from `camelot.view.model_thread.AbstractModelThread`: `thread_busy_signal`

Properties
Inherited from `object`: `__class__`

Method Details

### __init__(self, setup_thread=<function setup_model at 0x95a4224>) (Constructor) | source code
@param setup_thread: function to be called at startup of the thread to initialize everything, by default this will setup the model. set to None if nothing should be done. Overrides: object.__init__

### run(self) | source code
Overrides: camelot.view.model_thread.AbstractModelThread.run

### post(self, *args, **kwargs) | source code
Post a request to the model thread, request should be a function that takes no arguments. The request function will be called within the model thread. When the request is finished, on first occasion, the response function will be called within the gui thread. The response function takes as arguments, the results of the request function. @param request: function to be called within the model thread @param response: a slot that will be called with the result of the request function @param exception: a slot that will be called in case request throws an exception Decorators: `@synchronized` Overrides: camelot.view.model_thread.AbstractModelThread.post (inherited documentation)

### pop(self, *args, **kwargs) | source code
Pop a task from the queue, return None if the queue is empty Decorators: `@synchronized`

### busy(self, *args, **kwargs) | source code
Return True or False indicating wether either the model or the gui thread is doing something Decorators: `@synchronized` Overrides: camelot.view.model_thread.AbstractModelThread.busy

### wait_on_work(*args, **kwargs) | source code
Wait for all work to be finished, this function should only be used to do unit testing and such, since it will block the calling thread until all work is done Decorators: `@gui_function` Overrides: camelot.view.model_thread.AbstractModelThread.wait_on_work