QTaurusBaseListener¶
digraph inheritance66b50f9e1d {
rankdir=UD;
ratio=compress;
size="8.0, 12.0";
"Logger" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="The taurus logger class. All taurus pertinent classes should inherit"];
"Object" -> "Logger" [arrowsize=0.5,style="setlinewidth(0.5)"];
"Object" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"QTaurusBaseListener" [URL="#taurus.qt.qtcore.taurusqlistener.QTaurusBaseListener",color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="Base class for QObjects listening to taurus events."];
"TaurusListener" -> "QTaurusBaseListener" [arrowsize=0.5,style="setlinewidth(0.5)"];
"TaurusListener" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="TaurusListener Interface"];
"Logger" -> "TaurusListener" [arrowsize=0.5,style="setlinewidth(0.5)"];
}
-
class
QTaurusBaseListener(name=None, parent=None)[source]¶ Bases:
taurus.core.tauruslistener.TaurusListenerBase class for QObjects listening to taurus events.
Note
getSignaller()is now unused and deprecated. This is because taurusEvent is implemented usingbaseSignal(), that doesn’t require the class to inherit from QObject.-
eventReceived(evt_src, evt_type, evt_value)[source]¶ The basic implementation of the event handling chain is as follows:
- eventReceived just calls
fireEvent()which emits a “taurusEvent” PyQt signal that is connected (bypreAttach()) to thefilterEvent()method. - After filtering,
handleEvent()is invoked with the resulting filtered event
Note
in the earlier steps of the chain (i.e., in
eventReceived()/fireEvent()), the code is executed in a Python thread, while from eventFilter ahead, the code is executed in a Qt thread. When writing widgets, one should normally work on the Qt thread (i.e. reimplementinghandleEvent())Parameters: - evt_src (
object) – object that triggered the event - evt_type (
TaurusEventType) – type of event - evt_value (
object) – event value
- eventReceived just calls
-
filterEvent(evt_src=-1, evt_type=-1, evt_value=-1)[source]¶ The event is processed by each and all filters in strict order unless one of them returns None (in which case the event is discarded)
Parameters: - evt_src (
object) – object that triggered the event - evt_type (
TaurusEventType) – type of event - evt_value (
object) – event value
- evt_src (
-
fireEvent(evt_src=None, evt_type=None, evt_value=None)[source]¶ Emits a “taurusEvent” signal. It is unlikely that you may need to reimplement this method in subclasses. Consider reimplementing
eventReceived()orhandleEvent()instead depending on whether you need to execute code in the python or Qt threads, respectivelyParameters: - evt_src (
objectorNone) – object that triggered the event - evt_type (
TaurusEventTypeorNone) – type of event - evt_value (
objectorNone) – event value
- evt_src (
-
getEventFilters()[source]¶ Returns the list of event filters for this widget
Return type: sequence<callable>Returns: the event filters
-
getSignaller(**kwargs)¶ Deprecated since version 4.0.
-
handleEvent(evt_src, evt_type, evt_value)[source]¶ Event handling. Default implementation does nothing. Reimplement as necessary
Parameters: - evt_src (
objectorNone) – object that triggered the event - evt_type (
TaurusEventTypeorNone) – type of event - evt_value (
objectorNone) – event value
- evt_src (
-
insertEventFilter(filter, index=-1)[source]¶ insert a filter in a given position
Parameters: - filter (
callable(evt_src, evt_type, evt_value) – ) a filter - index (
int) – index to place the filter (default = -1 meaning place at the end)
See also: setEventFilters
- filter (
-
setEventFilters(filters=None)[source]¶ sets the taurus event filters list. The filters are run in order, using each output to feed the next filter. A filter must be a function that accepts 3 arguments
(evt_src, evt_type, evt_value)If the event is to be ignored, the filter must return None. If the event is not to be ignored, filter must return a(evt_src, evt_type, evt_value)tuple which may (or not) differ from the input.For a library of common filters, see taurus/core/util/eventfilters.py
Parameters: filters ( sequence) – a sequence of filtersSee also: insertEventFilter
-
taurusEvent¶ Base signal taurusEvent
-