Represents a lengend in the tree structure. More...
#include <LegendItem.h>
Public Member Functions | |
Instantiation Methods | |
Methods related to creation and destruction of the object. | |
LegendItem (const te::se::Rule *rule) | |
Constructor. More... | |
LegendItem (const std::string &label, const std::vector< te::se::Symbolizer * > &symbolizers) | |
Constructor. More... | |
~LegendItem () | |
Destructor. More... | |
Reimplementation of TreeItem | |
Methods reimplemented of the TreeItem class. | |
std::string | m_label |
Label for presenting in the Qt view. More... | |
QIcon | m_icon |
Item icon. More... | |
std::string | getAsString () const |
Returns the label of the item to be presented in a Qt view. More... | |
Qt::ItemFlags | flags () |
Returns the flags to be used by the model. More... | |
QIcon | getIcon () const |
Returns the image of the style as an icon. More... | |
void | updateSymbol (const te::se::Rule *rule) |
updateSymbol More... | |
void | updateSymbol (const std::vector< te::se::Symbolizer * > &symbolizers) |
Instantiation Methods | |
Methods related to creation and destruction of the object. | |
std::string | m_type |
Item type. More... | |
std::unique_ptr< Queue > | m_children |
Queue of items (children). More... | |
TreeItem * | m_parent |
Pointer to the parent. More... | |
void | setParent (TreeItem *item) |
Updates the item parent. More... | |
virtual void | addChild (TreeItem *item) |
Adds a child to the item. The child is added to the end of the list. More... | |
virtual void | insertChild (TreeItem *item, const size_t &pos) |
Inserts a child item at the desired position. More... | |
TreeItem * | getChild (const size_t &pos) const |
Returns the child located at pos. More... | |
TreeItem * | getParent () const |
Returns the item parent. More... | |
TreeItem * | removeChild (const size_t &pos) |
Removes the child located at pos from the children list. More... | |
size_t | getChildrenCount (const std::string &type) const |
Returns the number of children. More... | |
void | getChildren (std::vector< TreeItem * > &items, const std::string &type) const |
Returns all children of a certain type. More... | |
bool | hasChildren () const |
Tells us if the item has children or not. More... | |
int | getPosition () |
Returns the position of item in its parent's list of children. More... | |
virtual VISIBLE | isVisible () const |
Returns the visibilty state of the item. More... | |
virtual void | setVisible (const VISIBLE &visible, const bool &updateAncestors=false, const bool &updateDescendents=false) |
Updates the visibilty state of the item. More... | |
std::string | getType () const |
Returns the type of the item. More... | |
virtual std::string | getToolTip () const |
Returns the item tooltip (for information purposes). More... | |
void | removeAllChilds () |
Removes all children. More... | |
Represents a lengend in the tree structure.
Definition at line 53 of file LegendItem.h.
te::qt::widgets::LegendItem::LegendItem | ( | const te::se::Rule * | rule | ) |
Constructor.
rule | The Rule that defines the legend item. |
te::qt::widgets::LegendItem::LegendItem | ( | const std::string & | label, |
const std::vector< te::se::Symbolizer * > & | symbolizers | ||
) |
Constructor.
label | The label to be presented. |
symbolizers | List of symbolizers used to create the icon. |
te::qt::widgets::LegendItem::~LegendItem | ( | ) |
Destructor.
|
virtualinherited |
Adds a child to the item. The child is added to the end of the list.
item | The child to be inserted. |
Reimplemented in te::qt::widgets::FolderItem.
|
virtual |
Returns the flags to be used by the model.
Reimplemented from te::qt::widgets::TreeItem.
|
virtual |
Returns the label of the item to be presented in a Qt view.
Implements te::qt::widgets::TreeItem.
|
inherited |
Returns the child located at pos.
pos | The position of the desired child at the children list. |
If | pos is greater or equal than the children list size, a te::common::Exception will be raised. |
|
inherited |
Returns all children of a certain type.
[out] | items | The set of items founded. |
type | The type of items that we are searching for. |
|
inherited |
Returns the number of children.
The type, defines the type of children we want to considere in the operation. If an empty string is given as argument, all kinds of children will be considered.
type | The type of children we want to calculate the number. |
QIcon te::qt::widgets::LegendItem::getIcon | ( | ) | const |
Returns the image of the style as an icon.
|
inherited |
Returns the item parent.
|
inherited |
Returns the position of item in its parent's list of children.
|
virtualinherited |
Returns the item tooltip (for information purposes).
Reimplemented in te::qt::widgets::LayerItem, te::qt::widgets::RuleItem, and te::qt::widgets::StyleItem.
|
inherited |
Returns the type of the item.
|
inherited |
Tells us if the item has children or not.
|
virtualinherited |
Inserts a child item at the desired position.
item | The child to be inserted. |
pos | The position of the child in the children list. |
If | pos is greater than the children list size, a te::common::Exception will be raised. |
Reimplemented in te::qt::widgets::FolderItem.
|
virtualinherited |
Returns the visibilty state of the item.
Reimplemented in te::qt::widgets::ChartItem, te::qt::widgets::FolderItem, te::qt::widgets::LayerItem, and te::qt::widgets::RuleItem.
|
inherited |
Removes all children.
|
inherited |
Removes the child located at pos from the children list.
pos | The position of the desired child at the children list. |
If | pos is greater or equal than the children list size, a te::common::Exception will be raised. |
|
inherited |
Updates the item parent.
item | The new parent. |
|
virtualinherited |
Updates the visibilty state of the item.
visible | The new visibility state. |
updateAncestors | Updates also ancestors states. |
updateDescendents | Updates also descendents states. |
Reimplemented in te::qt::widgets::ChartItem, te::qt::widgets::FolderItem, te::qt::widgets::LayerItem, and te::qt::widgets::RuleItem.
void te::qt::widgets::LegendItem::updateSymbol | ( | const std::vector< te::se::Symbolizer * > & | symbolizers | ) |
void te::qt::widgets::LegendItem::updateSymbol | ( | const te::se::Rule * | rule | ) |
updateSymbol
symbolizers |
|
protectedinherited |
Queue of items (children).
Definition at line 237 of file TreeItem.h.
|
protected |
Item icon.
Definition at line 114 of file LegendItem.h.
|
protected |
Label for presenting in the Qt view.
Definition at line 113 of file LegendItem.h.
|
protectedinherited |
Pointer to the parent.
Definition at line 238 of file TreeItem.h.
|
protectedinherited |
Item type.
Definition at line 236 of file TreeItem.h.