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

KDEUI

KExtendableItemDelegate Class Reference

#include <kextendableitemdelegate.h>

Inheritance diagram for KExtendableItemDelegate:

Inheritance graph
[legend]

List of all members.


Detailed Description

Definition at line 51 of file 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

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)

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 65 of file kextendableitemdelegate.cpp.

KExtendableItemDelegate::~KExtendableItemDelegate (  )  [virtual]

Definition at line 74 of file kextendableitemdelegate.cpp.


Member Function Documentation

void KExtendableItemDelegate::contractAll (  ) 

Close all extenders and delete all extender widgets.

Definition at line 117 of file kextendableitemdelegate.cpp.

void KExtendableItemDelegate::contractItem ( const QModelIndex &  index  ) 

Close the extender that logically belongs to index from the view.

The extender widget will be deleted.

Definition at line 104 of file kextendableitemdelegate.cpp.

QPixmap KExtendableItemDelegate::contractPixmap (  )  [protected]

Return the pixmap that is displayed to contract an item.

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

void KExtendableItemDelegate::extendItem ( QWidget *  extender,
const QModelIndex &  index 
)

Insert the extender that logically belongs to index into the view.

If you need a parent for the extender at construction time, use the itemview's viewport(). The extender will be reparented and resized to the viewport by this function.

Definition at line 80 of file kextendableitemdelegate.cpp.

QPixmap KExtendableItemDelegate::extendPixmap (  )  [protected]

Return the pixmap that is displayed to extend an item.

Definition at line 416 of file kextendableitemdelegate.cpp.

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

Return whether there is an extender that belongs to index.

Definition at line 163 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 187 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 410 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 404 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 169 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 371 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
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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