digiKam
|
Public Member Functions | |
DWItemDelegate (QAbstractItemView *const itemView, QObject *const parent=nullptr) | |
QPersistentModelIndex | focusedIndex () const |
QAbstractItemView * | itemView () const |
~DWItemDelegate () override | |
Protected Member Functions | |
QList< QEvent::Type > | blockedEventTypes (QWidget *const widget) const |
virtual QList< QWidget * > | createItemWidgets (const QModelIndex &index) const =0 |
void | setBlockedEventTypes (QWidget *const widget, const QList< QEvent::Type > &types) const |
virtual void | updateItemWidgets (const QList< QWidget * > &widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const =0 |
Friends | |
class | DWItemDelegateEventListener |
class | DWItemDelegatePool |
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.
|
explicit |
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 |
References itemView(), and Digikam::DWItemDelegatePrivate::itemView.
|
override |
|
protected |
Retrieves the list of blocked event types for the given widget.
widget | the specified widget. |
|
protectedpure virtual |
Creates the list of widgets needed for an item.
Implemented in Digikam::SetupCollectionDelegate.
Referenced by Digikam::DWItemDelegatePool::findWidgets().
QPersistentModelIndex Digikam::DWItemDelegate::focusedIndex | ( | ) | const |
Retrieves the currently focused index. An invalid index if none is focused.
References Digikam::DWItemDelegatePrivate::itemView, Digikam::DWItemDelegatePoolPrivate::widgetInIndex, and Digikam::DWItemDelegatePrivate::widgetPool.
QAbstractItemView * Digikam::DWItemDelegate::itemView | ( | ) | const |
Retrieves the item view this delegate is monitoring.
References Digikam::DWItemDelegatePrivate::itemView.
Referenced by DWItemDelegate(), and Digikam::SetupCollectionDelegate::updateItemWidgets().
|
protected |
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 |
|
protectedpure virtual |
Updates a list of widgets for its use inside of the delegate (painting or event handling).
widgets | the widgets to update |
option | the current set of style options for the view. |
index | the model index of the item currently manipulated. |
Implemented in Digikam::SetupCollectionDelegate.
Referenced by Digikam::DWItemDelegatePool::findWidgets().
|
friend |
|
friend |