A class for rendering icons for layer and folder itens. More...
#include <LayerViewDelegate.h>
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... | |
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.
Definition at line 57 of file LayerViewDelegate.h.
| te::qt::widgets::LayerViewDelegate::LayerViewDelegate | ( | QStyledItemDelegate * | decorated, |
| QObject * | parent = 0 |
||
| ) |
Constructor.
| decorated | The delegate to be decorated. |
| parent | Used by Qt5. |
Definition at line 10 of file LayerViewDelegate.cpp.
References m_chart, m_colorMap, m_folder, m_invalidLayer, m_layer, m_queryLayer, m_style, m_tabularLayer, and ~LayerViewDelegate().
|
default |
Destructor.
Referenced by LayerViewDelegate().
|
inherited |
Returns the Decorator that decorates this item.
| decorated | The decorated item that we are looking for. |
|
inherited |
Returns the pointer of decorated object.
|
protected |
Returns the icon for a given index.
| index | Index of the object being rendered. |
Definition at line 67 of file LayerViewDelegate.cpp.
References te::qt::widgets::TreeItem::getType(), m_invalidLayer, m_layer, m_queryLayer, and m_tabularLayer.
Referenced by paint().
| void te::qt::widgets::LayerViewDelegate::paint | ( | QPainter * | painter, |
| const QStyleOptionViewItem & | option, | ||
| const QModelIndex & | index | ||
| ) | const |
Definition at line 27 of file LayerViewDelegate.cpp.
References endif(), getIcon(), te::qt::widgets::TreeItem::getType(), if(), m_chart, m_colorMap, te::common::Decorator< QStyledItemDelegate >::m_decorated, m_folder, m_style, and paint().
|
inherited |
Removes The decorator of the decorated.
| decorated | The item that we are searching for the decorator. |
|
protected |
Icon for a chart.
Definition at line 108 of file LayerViewDelegate.h.
Referenced by LayerViewDelegate(), and paint().
|
protected |
Icon for a ColorMap.
Definition at line 107 of file LayerViewDelegate.h.
Referenced by LayerViewDelegate(), and paint().
|
protectedinherited |
The object decorated.
Definition at line 98 of file Decorator.h.
Referenced by te::qt::plugins::wfs::WFSItemDelegate::paint(), te::qt::plugins::wms::WMSItemDelegate::paint(), EditDelegate::paint(), te::qt::plugins::st::STItemDelegate::paint(), te::qt::widgets::ThemeViewDelegate::paint(), te::qt::widgets::RasterLayerDelegate::paint(), te::ws::ogc::wms::qt::WMSItemDelegate::paint(), and paint().
|
protectedinherited |
If true, also delete decorated pointer.
Definition at line 99 of file Decorator.h.
|
protected |
Icon for a folder.
Definition at line 105 of file LayerViewDelegate.h.
Referenced by LayerViewDelegate(), and paint().
|
protected |
Icon for an invalid layers.
Definition at line 111 of file LayerViewDelegate.h.
Referenced by getIcon(), and LayerViewDelegate().
|
protected |
Icon for a layer not invalid.
Definition at line 104 of file LayerViewDelegate.h.
Referenced by getIcon(), and LayerViewDelegate().
|
protected |
Icon for a query layer.
Definition at line 109 of file LayerViewDelegate.h.
Referenced by getIcon(), and LayerViewDelegate().
|
protected |
Icon for a style.
Definition at line 106 of file LayerViewDelegate.h.
Referenced by LayerViewDelegate(), and paint().
|
protected |
Icon for a tabular layer.
Definition at line 110 of file LayerViewDelegate.h.
Referenced by getIcon(), and LayerViewDelegate().