KDEUI
kextendableitemdelegate.cpp
Go to the documentation of this file.
88 // kDebug() << "Creating extender at " << ext << " for item " << index.model()->data(index,Qt::DisplayRole).toString();
117 // kDebug() << "Collapse extender at " << extender << " for item " << index.model()->data(index,Qt::DisplayRole).toString();
178 QSize KExtendableItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
198 void KExtendableItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
223 const bool showExtensionIndicator = index.model()->data(index, ShowExtensionIndicatorRole).toBool();
278 //an extender is present - make two rectangles: one to paint the original item, one for the extender
314 QRect KExtendableItemDelegate::extenderRect(QWidget *extender, const QStyleOptionViewItem &option, const QModelIndex &index) const
345 QSize KExtendableItemDelegate::Private::maybeExtendedSize(const QStyleOptionViewItem &option, const QModelIndex &index) const
367 itemHeight = qMax(itemHeight, q->QStyledItemDelegate::sizeHint(option, neighborIndex).height());
370 //we only want to reserve vertical space, the horizontal extender layout is our private business.
376 QModelIndex KExtendableItemDelegate::Private::indexOfExtendedColumnInSameRow(const QModelIndex &index) const
395 void KExtendableItemDelegate::updateExtenderGeometry(QWidget *extender, const QStyleOptionViewItem &option,
virtual void setRootIndex(const QModelIndex &index)
QPixmap extendPixmap()
Return the pixmap that is displayed to extend an item.
Definition: kextendableitemdelegate.cpp:440
bool isRightToLeft()
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const =0
virtual void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const
void contractItem(const QModelIndex &index)
Remove the extender of item at index from the view.
Definition: kextendableitemdelegate.cpp:111
int & rwidth()
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Re-implemented for internal reasons.
Definition: kextendableitemdelegate.cpp:198
void save()
QWidget * viewport() const
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:395
void setParent(QWidget *parent)
void setGeometry(int x, int y, int w, int h)
bool isExtended(const QModelIndex &index) const
Return whether there is an extender that belongs to index.
Definition: kextendableitemdelegate.cpp:172
width
virtual ~KExtendableItemDelegate()
Definition: kextendableitemdelegate.cpp:80
bool isValid() const
bool isValid() const
Definition: kstandardshortcut.h:69
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
void setTop(int y)
void drawPixmap(const QRectF &target, const QPixmap &pixmap, const QRectF &source)
int row() const
void contractAll()
Close all extenders and delete all extender widgets.
Definition: kextendableitemdelegate.cpp:130
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
virtual QVariant data(const QModelIndex &index, int role) const =0
void deleteLater()
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:314
void hide()
QModelIndex parent() const
QScrollBar * verticalScrollBar() const
void setExtendPixmap(const QPixmap &pixmap)
The pixmap that is displayed to extend an item.
Definition: kextendableitemdelegate.cpp:428
sizeHint
void extendItem(QWidget *extender, const QModelIndex &index)
Insert the extender for item at index into the view.
Definition: kextendableitemdelegate.cpp:86
QModelIndex rootIndex() const
void restore()
QPixmap contractPixmap()
Return the pixmap that is displayed to contract an item.
Definition: kextendableitemdelegate.cpp:446
void setRight(int x)
const QAbstractItemModel * model() const
KExtendableItemDelegate(QAbstractItemView *parent)
Create a new KExtendableItemDelegate that belongs to parent.
Definition: kextendableitemdelegate.cpp:71
void setContractPixmap(const QPixmap &pixmap)
The pixmap that is displayed to contract an item.
Definition: kextendableitemdelegate.cpp:434
QStyle * style()
QModelIndex sibling(int row, int column) const
virtual int columnCount(const QModelIndex &parent) const =0
int height() const
int bottom() const
int column() const
bool toBool() const
virtual void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const =0
void extenderCreated(QWidget *extender, const QModelIndex &index)
This signal indicates that the item at index was extended with extender.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Re-implemented for internal reasons.
Definition: kextendableitemdelegate.cpp:178
void setLeft(int x)
void destroyed(QObject *obj)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.