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

KDEUI

Public Types | Signals | Public Member Functions | Protected Member Functions | List of all members
KExtendableItemDelegate Class Reference

#include <kextendableitemdelegate.h>

Inheritance diagram for KExtendableItemDelegate:
Inheritance graph
[legend]

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
 

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

KExtendableItemDelegate::~KExtendableItemDelegate ( )
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.

QPixmap KExtendableItemDelegate::contractPixmap ( )
protected

Return the pixmap that is displayed to contract an item.

Definition at line 446 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 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.

QPixmap KExtendableItemDelegate::extendPixmap ( )
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.

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

Re-implemented for internal reasons.

API not affected.

Definition at line 198 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 434 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 428 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 178 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 395 of file kextendableitemdelegate.cpp.


The documentation for this class was generated from the following files:
  • kextendableitemdelegate.h
  • kextendableitemdelegate.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal