KDEUI
#include <kextendableitemdelegate.h>
Public Types | |
enum | auxDataRoles { ShowExtensionIndicatorRole = Qt::UserRole + 200 } |
Signals | |
void | extenderCreated (QWidget *extender, const QModelIndex &index) |
void | extenderDestroyed (QWidget *extender, const QModelIndex &index) |
Public Member Functions | |
KExtendableItemDelegate (QAbstractItemView *parent) | |
virtual | ~KExtendableItemDelegate () |
void | contractAll () |
void | contractItem (const QModelIndex &index) |
void | extendItem (QWidget *extender, const QModelIndex &index) |
bool | isExtended (const QModelIndex &index) const |
virtual void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const |
virtual QSize | sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const |
virtual void | updateExtenderGeometry (QWidget *extender, const QStyleOptionViewItem &option, const QModelIndex &index) const |
Protected Member Functions | |
QPixmap | contractPixmap () |
QRect | extenderRect (QWidget *extender, const QStyleOptionViewItem &option, const QModelIndex &index) const |
QPixmap | extendPixmap () |
void | setContractPixmap (const QPixmap &pixmap) |
void | setExtendPixmap (const QPixmap &pixmap) |
Detailed Description
Definition at line 51 of file kextendableitemdelegate.h.
Member Enumeration Documentation
Enumerator | |
---|---|
ShowExtensionIndicatorRole |
Definition at line 55 of file kextendableitemdelegate.h.
Constructor & Destructor Documentation
KExtendableItemDelegate::KExtendableItemDelegate | ( | QAbstractItemView * | parent | ) |
Create a new KExtendableItemDelegate that belongs to parent
.
In contrast to generic QAbstractItemDelegates, an instance of this class can only ever be the delegate for one instance of af QAbstractItemView subclass.
Definition at line 71 of file kextendableitemdelegate.cpp.
|
virtual |
Definition at line 80 of file kextendableitemdelegate.cpp.
Member Function Documentation
void KExtendableItemDelegate::contractAll | ( | ) |
Close all extenders and delete all extender widgets.
Definition at line 130 of file kextendableitemdelegate.cpp.
void KExtendableItemDelegate::contractItem | ( | const QModelIndex & | index | ) |
Remove the extender of item at index
from the view.
The extender widget will be deleted.
Definition at line 111 of file kextendableitemdelegate.cpp.
|
protected |
Return the pixmap that is displayed to contract an item.
Definition at line 446 of file kextendableitemdelegate.cpp.
|
signal |
This signal indicates that the item at index
was extended with extender
.
|
signal |
This signal indicates that the extender
belonging to index
has emitted the destroyed() signal.
|
protected |
Reimplement this function to fine-tune the position of the extender.
option.rect
will be a rectangle that is as wide as the viewport and as high as the usual item height plus the extender size hint's height. Its upper left corner will be at the upper left corner of the usual item. You can place the returned rectangle of this function anywhere inside that area.
Definition at line 314 of file kextendableitemdelegate.cpp.
void KExtendableItemDelegate::extendItem | ( | QWidget * | extender, |
const QModelIndex & | index | ||
) |
Insert the extender
for item at index
into the view.
If you need a parent for the extender at construction time, use the itemview's viewport(). The delegate takes ownership of the extender; the extender will also be reparented and resized to the viewport.
Definition at line 86 of file kextendableitemdelegate.cpp.
|
protected |
Return the pixmap that is displayed to extend an item.
Definition at line 440 of file kextendableitemdelegate.cpp.
bool KExtendableItemDelegate::isExtended | ( | const QModelIndex & | index | ) | const |
Return whether there is an extender that belongs to index
.
Definition at line 172 of file kextendableitemdelegate.cpp.
|
virtual |
Re-implemented for internal reasons.
API not affected.
Definition at line 198 of file kextendableitemdelegate.cpp.
|
protected |
The pixmap that is displayed to contract an item.
pixmap
must have the same size as the pixmap in setExtendPixmap.
Definition at line 434 of file kextendableitemdelegate.cpp.
|
protected |
The pixmap that is displayed to extend an item.
pixmap
must have the same size as the pixmap in setContractPixmap.
Definition at line 428 of file kextendableitemdelegate.cpp.
|
virtual |
Re-implemented for internal reasons.
API not affected.
Definition at line 178 of file kextendableitemdelegate.cpp.
|
virtual |
Reimplement this function to adjust the internal geometry of the extender.
The external geometry of the extender will be set by the delegate.
Definition at line 395 of file kextendableitemdelegate.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.