cola.qobserver – QObserver base class

This module provides the QObserver class which allows for simple correspondancies between model parameters and Qt widgets.

The QObserver class handles receiving notifications from model classes and updating Qt widgets accordingly.

Qt signals are also relayed back to the model so that changes are always available in the model without having to worry about the different ways to query Qt widgets.

class cola.qobserver.QObserver(model, view, *args, **kwargs)
SLOT(*args)
Default slot to handle all Qt callbacks. This method delegates to callbacks from add_signals.
add_actions(**kwargs)
Register view actions that are called in response to view changes.(view->model)
add_callbacks(**callbacks)
Registers callbacks that are called in response to GUI events.
add_observables(*params)
This method assumes that widgets and model params share the same name.
add_signals(signal_str, *objects)
Connects object’s signal to the QObserver.
autoconnect(*widgets)
connect(obj, signal_str, *args)
Convenience function so that subclasses do not have to import QtCore.SIGNAL.
model_to_view(model_param, *widgets)
Binds model params to qt widgets(model->view)
refresh_view(*params)
Sends a notification message for each known model parameter.
subject_changed(param, value)
Sends a model param to the view(model->view)

Previous topic

cola.observer – Observer base class

Next topic

cola.errors – Custom exceptions

This Page