te::qt::widgets::StyleExplorer Class Reference

A widget used to explore a style. More...

#include <StyleExplorer.h>

Inheritance diagram for te::qt::widgets::StyleExplorer:
QTreeWidget

Public Slots

void onSymbolizerChanged (te::se::Symbolizer *symb)
 

Signals

void ruleClicked (te::se::Rule *rule)
 
void styleImported (te::se::Style *style, bool isVisual)
 
void symbolizerClicked (te::se::Symbolizer *symb)
 

Public Member Functions

te::se::RulegetCurrentRule ()
 Gets the current rule. More...
 
te::se::SymbolizergetCurrentSymbolizer ()
 Gets the current symbolizer. More...
 
void goDownSymbolizer ()
 
void goUpSymbolizer ()
 
void importStyle (te::se::Style *style, bool isVisual)
 
void setLegendIconSize (int size)
 
void setStyle (te::se::Style *style, te::se::Rule *currentRule=0)
 Sets a style element to this widget. More...
 
void updateStyleTree (te::se::Rule *currentRule=0)
 This method updates the Style Explorer. More...
 
Initializer Methods

Methods related to instantiation and destruction.

 StyleExplorer (QWidget *parent=0)
 Constructs a style explorer widget which is a child of parent. More...
 
 ~StyleExplorer ()
 Destructor. More...
 

Private Types

enum  NodeType { STYLE = 0, RULE = 1, SYMBOLIZER = 2 }
 Auxiliary internal enumeration to control the StyleExplorer tree nodes. More...
 

Private Slots

void onItemClicked (QTreeWidgetItem *item, int column)
 

Private Member Functions

te::se::RulegetRule (QTreeWidgetItem *item)
 Auxiliary internal method to retrieve a rule from a QTreeWidgetItem. More...
 
QTreeWidgetItemgetSelectedItem () const
 Auxiliary internal method to retrieve the selected item on Style Explorer. More...
 
te::se::SymbolizergetSymbolizer (QTreeWidgetItem *item)
 Auxiliary internal method to retrieve a symbolizer from a QTreeWidgetItem. More...
 
void swapSymbolizers (te::se::Rule *r, int indexFirst, int indexSecond)
 

Private Attributes

te::se::Stylem_style
 Style element that will be explored by this widget. More...
 
std::map< QString, QString > m_symbolizerNames
 A map of symbolizers names to user interface names. More...
 

Detailed Description

A widget used to explore a style.

Definition at line 60 of file widgets/se/StyleExplorer.h.

Member Enumeration Documentation

Auxiliary internal enumeration to control the StyleExplorer tree nodes.

Enumerator
STYLE 

Style root node.

RULE 

Rule node.

SYMBOLIZER 

Symbolizer node.

Definition at line 71 of file widgets/se/StyleExplorer.h.

Constructor & Destructor Documentation

te::qt::widgets::StyleExplorer::StyleExplorer ( QWidget parent = 0)

Constructs a style explorer widget which is a child of parent.

Definition at line 37 of file widgets/se/StyleExplorer.cpp.

References m_symbolizerNames, onItemClicked(), and ~StyleExplorer().

te::qt::widgets::StyleExplorer::~StyleExplorer ( )
default

Destructor.

Referenced by StyleExplorer().

Member Function Documentation

te::se::Rule * te::qt::widgets::StyleExplorer::getCurrentRule ( )

Gets the current rule.

Returns
The current rule on Style Explorer.
Note
If there is not a current rule a NULL point will be returned.

Definition at line 142 of file widgets/se/StyleExplorer.cpp.

References getRule(), getSelectedItem(), RULE, and SYMBOLIZER.

Referenced by goDownSymbolizer(), goUpSymbolizer(), and onSymbolizerChanged().

te::se::Symbolizer * te::qt::widgets::StyleExplorer::getCurrentSymbolizer ( )

Gets the current symbolizer.

Returns
The current symbolizer on Style Explorer.
Note
If there is not a current symbolizer a NULL point will be returned.

Definition at line 158 of file widgets/se/StyleExplorer.cpp.

References getSelectedItem(), getSymbolizer(), and SYMBOLIZER.

te::se::Rule * te::qt::widgets::StyleExplorer::getRule ( QTreeWidgetItem item)
private

Auxiliary internal method to retrieve a rule from a QTreeWidgetItem.

Definition at line 241 of file widgets/se/StyleExplorer.cpp.

References te::se::Style::getRule(), m_style, and RULE.

Referenced by getCurrentRule(), getSymbolizer(), and onItemClicked().

QTreeWidgetItem * te::qt::widgets::StyleExplorer::getSelectedItem ( ) const
private

Auxiliary internal method to retrieve the selected item on Style Explorer.

Returns
The selected QTreeWidgetItem on Style Explorer.
Note
If there is not a selected QTreeWidgetItem a NULL point will be returned.

Definition at line 273 of file widgets/se/StyleExplorer.cpp.

Referenced by getCurrentRule(), getCurrentSymbolizer(), goDownSymbolizer(), goUpSymbolizer(), and onSymbolizerChanged().

te::se::Symbolizer * te::qt::widgets::StyleExplorer::getSymbolizer ( QTreeWidgetItem item)
private

Auxiliary internal method to retrieve a symbolizer from a QTreeWidgetItem.

Definition at line 252 of file widgets/se/StyleExplorer.cpp.

References getRule(), te::se::Rule::getSymbolizers(), and SYMBOLIZER.

Referenced by getCurrentSymbolizer(), onItemClicked(), and updateStyleTree().

void te::qt::widgets::StyleExplorer::goDownSymbolizer ( )
void te::qt::widgets::StyleExplorer::goUpSymbolizer ( )
void te::qt::widgets::StyleExplorer::importStyle ( te::se::Style style,
bool  isVisual 
)

Definition at line 219 of file widgets/se/StyleExplorer.cpp.

References styleImported().

void te::qt::widgets::StyleExplorer::onItemClicked ( QTreeWidgetItem item,
int  column 
)
privateslot
void te::qt::widgets::StyleExplorer::onSymbolizerChanged ( te::se::Symbolizer symb)
slot
void te::qt::widgets::StyleExplorer::ruleClicked ( te::se::Rule rule)
signal

This signal is emitted when a rule is clicked.

Referenced by onItemClicked().

void te::qt::widgets::StyleExplorer::setLegendIconSize ( int  size)

Definition at line 212 of file widgets/se/StyleExplorer.cpp.

References updateStyleTree().

void te::qt::widgets::StyleExplorer::setStyle ( te::se::Style style,
te::se::Rule currentRule = 0 
)

Sets a style element to this widget.

Parameters
styleA valid style element.
Note
The widget will NOT take the ownership of the given style.
The widget will be update based on given style parameters.

Definition at line 59 of file widgets/se/StyleExplorer.cpp.

References m_style, and updateStyleTree().

void te::qt::widgets::StyleExplorer::styleImported ( te::se::Style style,
bool  isVisual 
)
signal

Referenced by importStyle().

void te::qt::widgets::StyleExplorer::swapSymbolizers ( te::se::Rule r,
int  indexFirst,
int  indexSecond 
)
private
void te::qt::widgets::StyleExplorer::symbolizerClicked ( te::se::Symbolizer symb)
signal

This signal is emitted when a symbolizer is clicked.

Referenced by onItemClicked(), and updateStyleTree().

Member Data Documentation

te::se::Style* te::qt::widgets::StyleExplorer::m_style
private

Style element that will be explored by this widget.

Definition at line 173 of file widgets/se/StyleExplorer.h.

Referenced by getRule(), setStyle(), and updateStyleTree().

std::map<QString, QString> te::qt::widgets::StyleExplorer::m_symbolizerNames
private

A map of symbolizers names to user interface names.

Definition at line 174 of file widgets/se/StyleExplorer.h.

Referenced by StyleExplorer(), and updateStyleTree().


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