te::qt::widgets::LayerViewDelegate Class Reference

A class for rendering icons for layer and folder itens. More...

#include <LayerViewDelegate.h>

Inheritance diagram for te::qt::widgets::LayerViewDelegate:
te::common::Decorator< QStyledItemDelegate >

Public Member Functions

QStyledItemDelegate * findDecorator (QStyledItemDelegate *decorated)
 Returns the Decorator that decorates this item. More...
 
QStyledItemDelegate * getDecorated ()
 Returns the pointer of decorated object.
More...
 
QStyledItemDelegate * removeDecorator (QStyledItemDelegate *decorated)
 Removes The decorator of the decorated. More...
 
Instantiation Methods

Methods related to creation and destruction of the object.

 LayerViewDelegate (QStyledItemDelegate *decorated, QObject *parent=0)
 Constructor. More...
 
 ~LayerViewDelegate ()
 Destructor. More...
 
Reimplementation of QStyledItemDelegate.

Methods reimplemented of the QStyledItemDelegate class.

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

Protected Member Functions

QIcon getIcon (const QModelIndex &index) const
 Returns the icon for a given index. More...
 

Protected Attributes

QIcon m_chart
 Icon for a chart. More...
 
QIcon m_colorMap
 Icon for a ColorMap. More...
 
QStyledItemDelegate * m_decorated
 The object decorated. More...
 
bool m_delDecorated
 If true, also delete decorated pointer. More...
 
QIcon m_folder
 Icon for a folder. More...
 
QIcon m_invalidLayer
 Icon for an invalid layers. More...
 
QIcon m_layer
 Icon for a layer not invalid. More...
 
QIcon m_queryLayer
 Icon for a query layer. More...
 
QIcon m_style
 Icon for a style. More...
 
QIcon m_tabularLayer
 Icon for a tabular layer. More...
 

Detailed Description

A class for rendering icons for layer and folder itens.

This is the default delegate for LayerItemView. It's used for present icons for the known kind of items. For unknown items, or if you want to change the known ones, you can create your own delegate and install it on the LayerItemView. Note that we use a decorator instead the QStyledItemDelegate. This is useful for making the inheritance dynamic.

See also
te::common::Decorator

Definition at line 57 of file LayerViewDelegate.h.

Constructor & Destructor Documentation

◆ LayerViewDelegate()

te::qt::widgets::LayerViewDelegate::LayerViewDelegate ( QStyledItemDelegate *  decorated,
QObject *  parent = 0 
)

Constructor.

Parameters
decoratedThe delegate to be decorated.
parentUsed by Qt5.

◆ ~LayerViewDelegate()

te::qt::widgets::LayerViewDelegate::~LayerViewDelegate ( )

Destructor.

Member Function Documentation

◆ findDecorator()

QStyledItemDelegate * te::common::Decorator< QStyledItemDelegate >::findDecorator ( QStyledItemDelegate *  decorated)
inherited

Returns the Decorator that decorates this item.

Parameters
decoratedThe decorated item that we are looking for.
Returns
The Decorator we are looking for or this if there's no decorators or 0 if not found.

Definition at line 140 of file Decorator.h.

◆ getDecorated()

QStyledItemDelegate * te::common::Decorator< QStyledItemDelegate >::getDecorated ( )
inherited

Returns the pointer of decorated object.

Definition at line 134 of file Decorator.h.

◆ getIcon()

QIcon te::qt::widgets::LayerViewDelegate::getIcon ( const QModelIndex &  index) const
protected

Returns the icon for a given index.

Parameters
indexIndex of the object being rendered.
Returns
The icon for the index.

◆ paint()

void te::qt::widgets::LayerViewDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const

◆ removeDecorator()

QStyledItemDelegate * te::common::Decorator< QStyledItemDelegate >::removeDecorator ( QStyledItemDelegate *  decorated)
inherited

Removes The decorator of the decorated.

Parameters
decoratedThe item that we are searching for the decorator.
Returns
The new item to be used as new Delegate or NULL.

Definition at line 154 of file Decorator.h.

References te::common::Decorator< T >::m_decorated, and te::common::Decorator< T >::m_delDecorated.

Member Data Documentation

◆ m_chart

QIcon te::qt::widgets::LayerViewDelegate::m_chart
protected

Icon for a chart.

Definition at line 108 of file LayerViewDelegate.h.

◆ m_colorMap

QIcon te::qt::widgets::LayerViewDelegate::m_colorMap
protected

Icon for a ColorMap.

Definition at line 107 of file LayerViewDelegate.h.

◆ m_decorated

QStyledItemDelegate * te::common::Decorator< QStyledItemDelegate >::m_decorated
protectedinherited

The object decorated.

Definition at line 98 of file Decorator.h.

◆ m_delDecorated

bool te::common::Decorator< QStyledItemDelegate >::m_delDecorated
protectedinherited

If true, also delete decorated pointer.

Definition at line 99 of file Decorator.h.

◆ m_folder

QIcon te::qt::widgets::LayerViewDelegate::m_folder
protected

Icon for a folder.

Definition at line 105 of file LayerViewDelegate.h.

◆ m_invalidLayer

QIcon te::qt::widgets::LayerViewDelegate::m_invalidLayer
protected

Icon for an invalid layers.

Definition at line 111 of file LayerViewDelegate.h.

◆ m_layer

QIcon te::qt::widgets::LayerViewDelegate::m_layer
protected

Icon for a layer not invalid.

Definition at line 104 of file LayerViewDelegate.h.

◆ m_queryLayer

QIcon te::qt::widgets::LayerViewDelegate::m_queryLayer
protected

Icon for a query layer.

Definition at line 109 of file LayerViewDelegate.h.

◆ m_style

QIcon te::qt::widgets::LayerViewDelegate::m_style
protected

Icon for a style.

Definition at line 106 of file LayerViewDelegate.h.

◆ m_tabularLayer

QIcon te::qt::widgets::LayerViewDelegate::m_tabularLayer
protected

Icon for a tabular layer.

Definition at line 110 of file LayerViewDelegate.h.


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