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 |
Public Member Functions inherited from QStyledItemDelegate | |
QStyledItemDelegate (QObject *parent) | |
~QStyledItemDelegate () | |
virtual QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const |
virtual QString | displayText (const QVariant &value, const QLocale &locale) const |
QItemEditorFactory * | itemEditorFactory () const |
virtual void | setEditorData (QWidget *editor, const QModelIndex &index) const |
void | setItemEditorFactory (QItemEditorFactory *factory) |
virtual void | setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const |
virtual void | updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const |
Public Member Functions inherited from QAbstractItemDelegate | |
QAbstractItemDelegate (QObject *parent) | |
virtual | ~QAbstractItemDelegate () |
void | closeEditor (QWidget *editor, QAbstractItemDelegate::EndEditHint hint) |
void | commitData (QWidget *editor) |
bool | helpEvent (QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index) |
virtual void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const =0 |
virtual QSize | sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const =0 |
void | sizeHintChanged (const QModelIndex &index) |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () 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) |
Protected Member Functions inherited from QStyledItemDelegate | |
virtual bool | editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) |
virtual bool | eventFilter (QObject *editor, QEvent *event) |
virtual void | initStyleOption (QStyleOptionViewItem *option, const QModelIndex &index) const |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Additional Inherited Members | |
Static Public Member Functions inherited from QAbstractItemDelegate | |
QString | elidedText (const QFontMetrics &fontMetrics, int width, Qt::TextElideMode mode, const QString &text) |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
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.
Reimplemented from QStyledItemDelegate.
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.
Reimplemented from QStyledItemDelegate.
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-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.