Skip to content

QT Dispatcher for bands #3

@danbradham

Description

@danbradham

Introduce a Dispatcher for bands that will dispatch channel receivers in the main qt thread. This can be implemented first in construct_ui, and possibly pushed upstream to bands when it's solid.

Something like this?

class QtDispatcherSignals(QtCore.QObject):
    dispatch_later = QtCore.Signal(object, object, object)

class QtDispatcher(bands.Dispatcher):
    def __init__(self):
        self._signals = QtDispatcherSignals()
        self._signals.dispatch_later.connect(self.qt_dispatch)

    def qt_dispatch(self, receiver, args, kwargs):
        receiver(*args, **kwargs)

    def dispatch(self, receiver, args, kwargs):
        self._signals.dispatch_later.emit(receiver, args, kwargs)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions