easymodel.widgetdelegate

Module for having arbitrary widgets in views.

Delegate

The WidgetDelegate enables an easy way to put arbitrary widgets in views. This is done by rendering the widget in the cells of the view. Ones the user edits the item, the delegate will give him an editor widget. Combined with the special views below, this will almost feel like real widgets. So if your widget has buttons, and you click on them, the click actually gets propagated to the widget.

Views

To make the widget delegates in the views behave like real widgets, we have to propagate click events. A user might see a button in a view and will try to click it. This will edit the item, so the delegate will give us a real editor widget and the click will be propagated to given widget. Mouse hovering etc is not supported at the moment and probably not good for performance.

You can either use the WidgetDelegateViewMixin for your own views or use one of the premade views: WD_AbstractItemView, WD_ListView, WD_TableView WD_TreeView.

Classes

WD_AbstractItemView(*args, **kwargs) A abstract item view that that when clicked, tries to issue a left click to the widget delegate.
WD_ListView(*args, **kwargs) A list view that that when clicked, tries to issue a left click to the widget delegate.
WD_TableView(*args, **kwargs) A table view that that when clicked, tries to issue a left click to the widget delegate.
WD_TreeView(*args, **kwargs) A tree view that that when clicked, tries to issue a left click to the widget delegate.
WidgetDelegate([parent]) A delegate for drawing a arbitrary QWidget
WidgetDelegateViewMixin(*args, **kwargs) Mixin for views to allow editing with mouseclicks, if there is a widgetdelegate.