QGIS API Documentation  2.2.0-Valmiera
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
QgsDetailedItemDelegate Class Reference

A custom model/view delegate that can display an icon, heading and detail sections. More...

#include <qgsdetaileditemdelegate.h>

Collaboration diagram for QgsDetailedItemDelegate:
Collaboration graph
[legend]

Public Member Functions

 QgsDetailedItemDelegate (QObject *parent=0)
 ~QgsDetailedItemDelegate ()
void paint (QPainter *thePainter, const QStyleOptionViewItem &theOption, const QModelIndex &theIndex) const
 reimplement for parent class
QSize sizeHint (const QStyleOptionViewItem &theOption, const QModelIndex &theIndex) const
 reimplement for parent class
void setVerticalSpacing (int theValue)
int verticalSpacing () const
void setHorizontalSpacing (int theValue)
int horizontalSpacing () const

Private Member Functions

QFont detailFont (const QStyleOptionViewItem &theOption) const
QFont categoryFont (const QStyleOptionViewItem &theOption) const
QFont titleFont (const QStyleOptionViewItem &theOption) const
void drawHighlight (const QStyleOptionViewItem &theOption, QPainter *thepPainter, int theHeight) const
QStringList wordWrap (QString theString, QFontMetrics theMetrics, int theWidth) const
void paintManually (QPainter *thePainter, const QStyleOptionViewItem &theOption, const QgsDetailedItemData theData) const
void paintAsWidget (QPainter *thePainter, const QStyleOptionViewItem &theOption, const QgsDetailedItemData theData) const
int height (const QStyleOptionViewItem &theOption, const QgsDetailedItemData theData) const

Private Attributes

QgsDetailedItemWidgetmpWidget
QCheckBox * mpCheckBox
int mVerticalSpacing
int mHorizontalSpacing

Detailed Description

A custom model/view delegate that can display an icon, heading and detail sections.

See Also
also QgsDetailedItemData

Definition at line 34 of file qgsdetaileditemdelegate.h.

Constructor & Destructor Documentation

QgsDetailedItemDelegate::QgsDetailedItemDelegate ( QObject *  parent = 0)
QgsDetailedItemDelegate::~QgsDetailedItemDelegate ( )

Definition at line 40 of file qgsdetaileditemdelegate.cpp.

References mpCheckBox, and mpWidget.

Member Function Documentation

QFont QgsDetailedItemDelegate::categoryFont ( const QStyleOptionViewItem &  theOption) const
private

Definition at line 309 of file qgsdetaileditemdelegate.cpp.

Referenced by height(), and paintManually().

QFont QgsDetailedItemDelegate::detailFont ( const QStyleOptionViewItem &  theOption) const
private

Definition at line 303 of file qgsdetaileditemdelegate.cpp.

Referenced by height(), paintManually(), and titleFont().

void QgsDetailedItemDelegate::drawHighlight ( const QStyleOptionViewItem &  theOption,
QPainter *  thepPainter,
int  theHeight 
) const
private

Definition at line 262 of file qgsdetaileditemdelegate.cpp.

Referenced by paintAsWidget(), and paintManually().

int QgsDetailedItemDelegate::height ( const QStyleOptionViewItem &  theOption,
const QgsDetailedItemData  theData 
) const
private
int QgsDetailedItemDelegate::horizontalSpacing ( ) const

Definition at line 387 of file qgsdetaileditemdelegate.cpp.

References mHorizontalSpacing.

Referenced by height(), and paintManually().

void QgsDetailedItemDelegate::paint ( QPainter *  thePainter,
const QStyleOptionViewItem &  theOption,
const QModelIndex &  theIndex 
) const

reimplement for parent class

Definition at line 46 of file qgsdetaileditemdelegate.cpp.

References QgsDetailedItemData::isRenderedAsWidget(), paintAsWidget(), and paintManually().

void QgsDetailedItemDelegate::paintAsWidget ( QPainter *  thePainter,
const QStyleOptionViewItem &  theOption,
const QgsDetailedItemData  theData 
) const
private
void QgsDetailedItemDelegate::paintManually ( QPainter *  thePainter,
const QStyleOptionViewItem &  theOption,
const QgsDetailedItemData  theData 
) const
private
void QgsDetailedItemDelegate::setHorizontalSpacing ( int  theValue)

Definition at line 393 of file qgsdetaileditemdelegate.cpp.

References mHorizontalSpacing.

Referenced by QgsDetailedItemDelegate().

void QgsDetailedItemDelegate::setVerticalSpacing ( int  theValue)

Definition at line 381 of file qgsdetaileditemdelegate.cpp.

References mVerticalSpacing.

Referenced by QgsDetailedItemDelegate().

QSize QgsDetailedItemDelegate::sizeHint ( const QStyleOptionViewItem &  theOption,
const QModelIndex &  theIndex 
) const

reimplement for parent class

Definition at line 70 of file qgsdetaileditemdelegate.cpp.

References height(), QgsDetailedItemData::isRenderedAsWidget(), and mpWidget.

QFont QgsDetailedItemDelegate::titleFont ( const QStyleOptionViewItem &  theOption) const
private

Definition at line 316 of file qgsdetaileditemdelegate.cpp.

References detailFont().

Referenced by height(), and paintManually().

int QgsDetailedItemDelegate::verticalSpacing ( ) const

Definition at line 375 of file qgsdetaileditemdelegate.cpp.

References mVerticalSpacing.

Referenced by height(), and paintManually().

QStringList QgsDetailedItemDelegate::wordWrap ( QString  theString,
QFontMetrics  theMetrics,
int  theWidth 
) const
private

Definition at line 325 of file qgsdetaileditemdelegate.cpp.

Referenced by height(), and paintManually().

Member Data Documentation

int QgsDetailedItemDelegate::mHorizontalSpacing
private

Definition at line 79 of file qgsdetaileditemdelegate.h.

Referenced by horizontalSpacing(), and setHorizontalSpacing().

QCheckBox* QgsDetailedItemDelegate::mpCheckBox
private
QgsDetailedItemWidget* QgsDetailedItemDelegate::mpWidget
private

Definition at line 76 of file qgsdetaileditemdelegate.h.

Referenced by paintAsWidget(), sizeHint(), and ~QgsDetailedItemDelegate().

int QgsDetailedItemDelegate::mVerticalSpacing
private

Definition at line 78 of file qgsdetaileditemdelegate.h.

Referenced by setVerticalSpacing(), and verticalSpacing().


The documentation for this class was generated from the following files: