KItemViews
kextendableitemdelegate.h
22 * This delegate makes it possible to display an arbitrary QWidget ("extender") that spans all columns below a line of items.
25 * It is your responsibility to devise a way to trigger extension and contraction of items, by calling
26 * extendItem() and contractItem(). You can e.g. reimplement itemActivated() and similar functions.
65 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
95 virtual void updateExtenderGeometry(QWidget *extender, const QStyleOptionViewItem &option, const QModelIndex &index) const;
104 * This signal indicates that the @p extender belonging to @p index has emitted the destroyed() signal.
110 * Reimplement this function to fine-tune the position of the extender. @p option.rect will be a rectangle
111 * that is as wide as the viewport and as high as the usual item height plus the extender size hint's height.
115 QRect extenderRect(QWidget *extender, const QStyleOptionViewItem &option, const QModelIndex &index) const;
118 * The pixmap that is displayed to extend an item. @p pixmap must have the same size as the pixmap in setContractPixmap.
QPixmap contractPixmap()
Return the pixmap that is displayed to contract an item.
Definition kextendableitemdelegate.cpp:406
void contractItem(const QModelIndex &index)
Remove the extender of item at index from the view.
Definition kextendableitemdelegate.cpp:92
void contractAll()
Close all extenders and delete all extender widgets.
Definition kextendableitemdelegate.cpp:110
QPixmap extendPixmap()
Return the pixmap that is displayed to extend an item.
Definition kextendableitemdelegate.cpp:401
void setExtendPixmap(const QPixmap &pixmap)
The pixmap that is displayed to extend an item.
Definition kextendableitemdelegate.cpp:391
void setContractPixmap(const QPixmap &pixmap)
The pixmap that is displayed to contract an item.
Definition kextendableitemdelegate.cpp:396
QRect extenderRect(QWidget *extender, const QStyleOptionViewItem &option, const QModelIndex &index) const
Reimplement this function to fine-tune the position of the extender.
Definition kextendableitemdelegate.cpp:284
bool isExtended(const QModelIndex &index) const
Return whether there is an extender that belongs to index.
Definition kextendableitemdelegate.cpp:147
KExtendableItemDelegate(QAbstractItemView *parent)
Create a new KExtendableItemDelegate that belongs to parent.
Definition kextendableitemdelegate.cpp:59
virtual void updateExtenderGeometry(QWidget *extender, const QStyleOptionViewItem &option, const QModelIndex &index) const
Reimplement this function to adjust the internal geometry of the extender.
Definition kextendableitemdelegate.cpp:362
void extendItem(QWidget *extender, const QModelIndex &index)
Insert the extender for item at index into the view.
Definition kextendableitemdelegate.cpp:68
void extenderDestroyed(QWidget *extender, const QModelIndex &index)
This signal indicates that the extender belonging to index has emitted the destroyed() signal.
void extenderCreated(QWidget *extender, const QModelIndex &index)
This signal indicates that the item at index was extended with extender.
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
void destroyed(QObject *obj)
QObject * parent() const const
QStyledItemDelegate(QObject *parent)
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const const override
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const const override
UserRole
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 21 2025 11:49:37 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 21 2025 11:49:37 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.