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

Kate

ExpandingDelegate Class Reference

This is a delegate that cares, together with ExpandingWidgetModel, about embedded widgets in tree-view. More...

#include <expandingdelegate.h>

Inheritance diagram for ExpandingDelegate:
QItemDelegate KateCompletionDelegate

List of all members.

Public Member Functions

QSize basicSizeHint (const QModelIndex &index) const
 ExpandingDelegate (ExpandingWidgetModel *model, QObject *parent=0L)
ExpandingWidgetModel * model () const
virtual void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const

Protected Member Functions

void adjustRect (QRect &rect) const
virtual void adjustStyle (const QModelIndex &index, QStyleOptionViewItem &option) const
virtual QList
< QTextLayout::FormatRange > 
createHighlighting (const QModelIndex &index, QStyleOptionViewItem &option) const
virtual void drawBackground (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
virtual void drawDecoration (QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, const QPixmap &pixmap) const
virtual void drawDisplay (QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, const QString &text) const
virtual bool editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index)
virtual void heightChanged () const
QList< QTextLayout::FormatRange > highlightingFromVariantList (const QList< QVariant > &customHighlights) const
void initStyleOption (QStyleOptionViewItem *option, const QModelIndex &index) const
virtual QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const

Protected Attributes

QColor m_backgroundColor
Qt::Alignment m_cachedAlignment
QList< QTextLayout::FormatRange > m_cachedHighlights
int m_currentColumnStart
QList< int > m_currentColumnStarts
QModelIndex m_currentIndex

Detailed Description

This is a delegate that cares, together with ExpandingWidgetModel, about embedded widgets in tree-view.

Definition at line 41 of file expandingdelegate.h.


Constructor & Destructor Documentation

ExpandingDelegate::ExpandingDelegate ( ExpandingWidgetModel *  model,
QObject *  parent = 0L 
) [explicit]

Definition at line 32 of file expandingdelegate.cpp.


Member Function Documentation

void ExpandingDelegate::adjustRect ( QRect &  rect  )  const [protected]

Definition at line 142 of file expandingdelegate.cpp.

void ExpandingDelegate::adjustStyle ( const QModelIndex &  index,
QStyleOptionViewItem &  option 
) const [protected, virtual]

Reimplemented in KateCompletionDelegate.

Definition at line 138 of file expandingdelegate.cpp.

QSize ExpandingDelegate::basicSizeHint ( const QModelIndex &  index  )  const

Definition at line 119 of file expandingdelegate.cpp.

QList< QTextLayout::FormatRange > ExpandingDelegate::createHighlighting ( const QModelIndex &  index,
QStyleOptionViewItem &  option 
) const [protected, virtual]

Reimplemented in KateCompletionDelegate.

Definition at line 113 of file expandingdelegate.cpp.

void ExpandingDelegate::drawBackground ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const [protected, virtual]

Definition at line 280 of file expandingdelegate.cpp.

void ExpandingDelegate::drawDecoration ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QRect &  rect,
const QPixmap &  pixmap 
) const [protected, virtual]

Definition at line 275 of file expandingdelegate.cpp.

void ExpandingDelegate::drawDisplay ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QRect &  rect,
const QString &  text 
) const [protected, virtual]

For some reason the text-formats seem to be invalid in some way, sometimes

Todo:
Fix this properly, it sucks not copying everything over

Definition at line 154 of file expandingdelegate.cpp.

bool ExpandingDelegate::editorEvent ( QEvent *  event,
QAbstractItemModel *  model,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) [protected, virtual]

Definition at line 295 of file expandingdelegate.cpp.

void ExpandingDelegate::heightChanged (  )  const [protected, virtual]

Reimplemented in KateCompletionDelegate.

Definition at line 292 of file expandingdelegate.cpp.

QList< QTextLayout::FormatRange > ExpandingDelegate::highlightingFromVariantList ( const QList< QVariant > &  customHighlights  )  const [protected]

Creates a list of FormatRanges as should be returned by createHighlighting from a list of QVariants as described in the kde header ktexteditor/codecompletionmodel.h.

Definition at line 315 of file expandingdelegate.cpp.

void ExpandingDelegate::initStyleOption ( QStyleOptionViewItem *  option,
const QModelIndex &  index 
) const [protected]
ExpandingWidgetModel * ExpandingDelegate::model (  )  const

Definition at line 288 of file expandingdelegate.cpp.

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

This is a bug workaround for the Qt raster paint engine: It paints over widgets embedded into the viewport when updating due to mouse events

Todo:
report to Qt Software

Definition at line 71 of file expandingdelegate.cpp.

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

Definition at line 123 of file expandingdelegate.cpp.


Member Data Documentation

QColor ExpandingDelegate::m_backgroundColor [mutable, protected]

Definition at line 85 of file expandingdelegate.h.

Qt::Alignment ExpandingDelegate::m_cachedAlignment [mutable, protected]

Definition at line 84 of file expandingdelegate.h.

QList<QTextLayout::FormatRange> ExpandingDelegate::m_cachedHighlights [mutable, protected]

Definition at line 82 of file expandingdelegate.h.

int ExpandingDelegate::m_currentColumnStart [mutable, protected]

Definition at line 80 of file expandingdelegate.h.

QList<int> ExpandingDelegate::m_currentColumnStarts [mutable, protected]

Definition at line 81 of file expandingdelegate.h.

QModelIndex ExpandingDelegate::m_currentIndex [mutable, protected]

Definition at line 86 of file expandingdelegate.h.


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

Kate

Skip menu "Kate"
  • Main Page
  • 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