• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

KExtendableItemDelegate Class Reference

#include <kextendableitemdelegate.h>

Inheritance diagram for KExtendableItemDelegate:
QStyledItemDelegate

List of all members.

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

void contractAll ()
void contractItem (const QModelIndex &index)
void extendItem (QWidget *extender, const QModelIndex &index)
bool isExtended (const QModelIndex &index) const
 KExtendableItemDelegate (QAbstractItemView *parent)
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
virtual ~KExtendableItemDelegate ()

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

enum KExtendableItemDelegate::auxDataRoles
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 61 of file kextendableitemdelegate.cpp.

KExtendableItemDelegate::~KExtendableItemDelegate (  )  [virtual]

Definition at line 70 of file kextendableitemdelegate.cpp.


Member Function Documentation

void KExtendableItemDelegate::contractAll (  ) 

Close all extenders and delete all extender widgets.

Definition at line 120 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 101 of file kextendableitemdelegate.cpp.

QPixmap KExtendableItemDelegate::contractPixmap (  )  [protected]

Return the pixmap that is displayed to contract an item.

Definition at line 435 of file kextendableitemdelegate.cpp.

void KExtendableItemDelegate::extenderCreated ( QWidget *  extender,
const QModelIndex &  index 
) [signal]

This signal indicates that the item at index was extended with extender.

void KExtendableItemDelegate::extenderDestroyed ( QWidget *  extender,
const QModelIndex &  index 
) [signal]

This signal indicates that the extender belonging to index has emitted the destroyed() signal.

QRect KExtendableItemDelegate::extenderRect ( QWidget *  extender,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const [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 309 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 76 of file kextendableitemdelegate.cpp.

QPixmap KExtendableItemDelegate::extendPixmap (  )  [protected]

Return the pixmap that is displayed to extend an item.

Definition at line 429 of file kextendableitemdelegate.cpp.

bool KExtendableItemDelegate::isExtended ( const QModelIndex &  index  )  const

Return whether there is an extender that belongs to index.

Definition at line 162 of file kextendableitemdelegate.cpp.

void KExtendableItemDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const [virtual]

Re-implemented for internal reasons.

API not affected.

Definition at line 188 of file kextendableitemdelegate.cpp.

void KExtendableItemDelegate::setContractPixmap ( const QPixmap &  pixmap  )  [protected]

The pixmap that is displayed to contract an item.

pixmap must have the same size as the pixmap in setExtendPixmap.

Definition at line 423 of file kextendableitemdelegate.cpp.

void KExtendableItemDelegate::setExtendPixmap ( const QPixmap &  pixmap  )  [protected]

The pixmap that is displayed to extend an item.

pixmap must have the same size as the pixmap in setContractPixmap.

Definition at line 417 of file kextendableitemdelegate.cpp.

QSize KExtendableItemDelegate::sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const [virtual]

Re-implemented for internal reasons.

API not affected.

Definition at line 168 of file kextendableitemdelegate.cpp.

void KExtendableItemDelegate::updateExtenderGeometry ( QWidget *  extender,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const [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 384 of file kextendableitemdelegate.cpp.


The documentation for this class was generated from the following files:
  • kextendableitemdelegate.h
  • kextendableitemdelegate.cpp

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal