class KWidgetItemDelegateabstract |
|
This class allows to create item delegates embedding simple widgets to interact
with items. For instance you can add push buttons, line edits, etc. to your delegate
and use them to modify the state of your model.
@since 4.1 |
|
Creates a new ItemDelegate to be used with a given itemview.
itemView - the item view the new delegate will monitor parent - the parent of this delegate |
|
Retrieves the list of blocked event types for the given widget.
widget - the specified widget. Returns the list of blocked event types, can be empty if no events are blocked. |
|
Creates the list of widgets needed for an item.
No initialization of the widgets is supposed to happen here. The widgets will be initialized based on needs for a given item. If you want to connect some widget signals to any slot, you should do it here. Returns the list of newly created widgets which will be used to interact with an item. See also updateItemWidgets() |
|
Retrieves the currently focused index. An invalid index if none is focused.
Returns the current focused index, or QPersistentModelIndex() if none is focused. |
|
Retrieves the item view this delegate is monitoring.
Returns the item view this delegate is monitoring |
|
Paint the widgets of the item. This method is meant to be used in the paint()
method of your item delegate implementation.
painter - the painter the widgets will be painted on. option - the current set of style options for the view. index - the model index of the item currently painted. |
|
Sets the list of event types that a widget will block.
Blocked events are not passed to the view. This way you can prevent an item from being selected when a button is clicked for instance. widget - the widget which must block events types - the list of event types the widget must block |
|
Updates a list of widgets for its use inside of the delegate (painting or
event handling).
All the positioning and sizing should be done in item coordinates. Do not make widget connections in here, since this method will be called very regularly. widgets - the widgets to update option - the current set of style options for the view. index - the model index of the item currently manipulated. |