All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::qt::widgets::BasicStrokeWidget Class Reference

A widget used to build a basic stroke element. More...

#include <BasicStrokeWidget.h>

Inheritance diagram for te::qt::widgets::BasicStrokeWidget:

Signals

void strokeChanged ()
 

Public Member Functions

te::se::StrokegetStroke () const
 Gets the configured stroke element. More...
 
void setStroke (const te::se::Stroke *stroke)
 Sets a stroke element to this widget. More...
 
Initializer Methods

Methods related to instantiation and destruction.

 BasicStrokeWidget (QWidget *parent=0, Qt::WindowFlags f=0)
 Constructs a basic stroke widget which is a child of parent, with widget flags set to f. More...
 
 ~BasicStrokeWidget ()
 Destructor. More...
 

Protected Slots

void onColorChanged (const QColor &color)
 
void onStrokeCapStyleChanged (int style)
 
void onStrokeDashComboBoxCurrentIndexChanged (int index)
 
void onStrokeJoinStyleChanged (int style)
 
void onStrokeOpacitySliderValueChanged (int value)
 
void onStrokeWidthDoubleSpinBoxValueChanged (const QString &text)
 

Protected Member Functions

void fillStrokeDashStyleComboBox ()
 Fills the widget form element used to visualize the stroke cap style. More...
 
void initialize ()
 Internal method to initialize the widget (e.g.: color, combos, icons, etc.) More...
 
void updateUi ()
 Updates the widget form based on internal stroke element. More...
 
void updateUiCapStyle (const std::string &style)
 Updates the widget form element used to visualize the stroke cap style. More...
 
void updateUiDashStyle (const std::string &pattern)
 Updates the widget form element used to visualize the stroke dash style. More...
 
void updateUiJoinStyle (const std::string &style)
 Updates the widget form element used to visualize the stroke join style. More...
 
void updateUiStrokeColor ()
 Updates the widget form element used to visualize the stroke color. More...
 

Private Attributes

QColor m_color
 Auxiliary color attribute. More...
 
ColorPickerToolButtonm_colorPicker
 Widget used to pick a color. More...
 
std::vector< std::string > m_dashes
 Predefined dash styles. TODO: it can be filled out, based on a file, etc (?) More...
 
te::se::Strokem_stroke
 Stroke element that will be configured by this widget. More...
 
QButtonGroup * m_strokeCapStyleButtonGroup
 Button group used to control the cap styles. More...
 
QButtonGroup * m_strokeJoinStyleButtonGroup
 Button group used to control the join styles. More...
 
std::auto_ptr
< Ui::BasicStrokeWidgetForm > 
m_ui
 Widget form. More...
 

Detailed Description

A widget used to build a basic stroke element.

Definition at line 64 of file BasicStrokeWidget.h.

Constructor & Destructor Documentation

te::qt::widgets::BasicStrokeWidget::BasicStrokeWidget ( QWidget *  parent = 0,
Qt::WindowFlags  f = 0 
)
te::qt::widgets::BasicStrokeWidget::~BasicStrokeWidget ( )

Destructor.

Definition at line 70 of file BasicStrokeWidget.cpp.

Member Function Documentation

void te::qt::widgets::BasicStrokeWidget::fillStrokeDashStyleComboBox ( )
protected

Fills the widget form element used to visualize the stroke cap style.

Definition at line 208 of file BasicStrokeWidget.cpp.

References te::map::GetDashStyle().

te::se::Stroke * te::qt::widgets::BasicStrokeWidget::getStroke ( ) const

Gets the configured stroke element.

Returns
The configured stroke element.
Note
The caller will take the ownership of the returned stroke.

Definition at line 86 of file BasicStrokeWidget.cpp.

References te::se::Stroke::clone().

Referenced by te::qt::widgets::LineSymbolizerWidget::LineSymbolizerWidget(), te::qt::widgets::PolygonSymbolizerWidget::PolygonSymbolizerWidget(), and te::qt::widgets::WellKnownMarkWidget::WellKnownMarkWidget().

void te::qt::widgets::BasicStrokeWidget::initialize ( )
protected

Internal method to initialize the widget (e.g.: color, combos, icons, etc.)

Definition at line 91 of file BasicStrokeWidget.cpp.

References te::map::BevelJoin, te::map::ButtCap, te::map::MiterJoin, te::map::RoundCap, te::map::RoundJoin, te::map::SquareCap, and TE_SE_DEFAULT_STROKE_BASIC_COLOR.

Referenced by BasicStrokeWidget().

void te::qt::widgets::BasicStrokeWidget::onColorChanged ( const QColor &  color)
protectedslot

Definition at line 249 of file BasicStrokeWidget.cpp.

Referenced by BasicStrokeWidget().

void te::qt::widgets::BasicStrokeWidget::onStrokeCapStyleChanged ( int  style)
protectedslot
void te::qt::widgets::BasicStrokeWidget::onStrokeDashComboBoxCurrentIndexChanged ( int  index)
protectedslot

Definition at line 279 of file BasicStrokeWidget.cpp.

Referenced by BasicStrokeWidget().

void te::qt::widgets::BasicStrokeWidget::onStrokeJoinStyleChanged ( int  style)
protectedslot
void te::qt::widgets::BasicStrokeWidget::onStrokeOpacitySliderValueChanged ( int  value)
protectedslot

Definition at line 261 of file BasicStrokeWidget.cpp.

Referenced by BasicStrokeWidget().

void te::qt::widgets::BasicStrokeWidget::onStrokeWidthDoubleSpinBoxValueChanged ( const QString &  text)
protectedslot

Definition at line 273 of file BasicStrokeWidget.cpp.

Referenced by BasicStrokeWidget().

void te::qt::widgets::BasicStrokeWidget::setStroke ( const te::se::Stroke stroke)

Sets a stroke element to this widget.

Parameters
strokeA valid stroke element.
Note
The widget will NOT take the ownership of the given stroke.
The widget form will be update based on given stroke parameters.

Definition at line 75 of file BasicStrokeWidget.cpp.

References te::se::Stroke::clone().

Referenced by te::qt::widgets::BasicStrokeDialog::getStroke().

void te::qt::widgets::BasicStrokeWidget::strokeChanged ( )
signal

This signal is emitted when the internal stroke element is changed.

void te::qt::widgets::BasicStrokeWidget::updateUi ( )
protected
void te::qt::widgets::BasicStrokeWidget::updateUiCapStyle ( const std::string &  style)
protected

Updates the widget form element used to visualize the stroke cap style.

Parameters
styleThe stroke cap style type.

Definition at line 199 of file BasicStrokeWidget.cpp.

References TE_SE_ROUND_CAP, and TE_SE_SQUARE_CAP.

void te::qt::widgets::BasicStrokeWidget::updateUiDashStyle ( const std::string &  pattern)
protected

Updates the widget form element used to visualize the stroke dash style.

Parameters
patternThe stroke dash style pattern.

Definition at line 168 of file BasicStrokeWidget.cpp.

void te::qt::widgets::BasicStrokeWidget::updateUiJoinStyle ( const std::string &  style)
protected

Updates the widget form element used to visualize the stroke join style.

Parameters
styleThe stroke join style type.

Definition at line 190 of file BasicStrokeWidget.cpp.

References TE_SE_BEVEL_JOIN, and TE_SE_ROUND_JOIN.

void te::qt::widgets::BasicStrokeWidget::updateUiStrokeColor ( )
protected

Updates the widget form element used to visualize the stroke color.

Definition at line 163 of file BasicStrokeWidget.cpp.

Member Data Documentation

QColor te::qt::widgets::BasicStrokeWidget::m_color
private

Auxiliary color attribute.

Definition at line 164 of file BasicStrokeWidget.h.

ColorPickerToolButton* te::qt::widgets::BasicStrokeWidget::m_colorPicker
private

Widget used to pick a color.

Definition at line 161 of file BasicStrokeWidget.h.

Referenced by BasicStrokeWidget().

std::vector<std::string> te::qt::widgets::BasicStrokeWidget::m_dashes
private

Predefined dash styles. TODO: it can be filled out, based on a file, etc (?)

Definition at line 166 of file BasicStrokeWidget.h.

te::se::Stroke* te::qt::widgets::BasicStrokeWidget::m_stroke
private

Stroke element that will be configured by this widget.

Definition at line 165 of file BasicStrokeWidget.h.

QButtonGroup* te::qt::widgets::BasicStrokeWidget::m_strokeCapStyleButtonGroup
private

Button group used to control the cap styles.

Definition at line 163 of file BasicStrokeWidget.h.

Referenced by BasicStrokeWidget().

QButtonGroup* te::qt::widgets::BasicStrokeWidget::m_strokeJoinStyleButtonGroup
private

Button group used to control the join styles.

Definition at line 162 of file BasicStrokeWidget.h.

Referenced by BasicStrokeWidget().

std::auto_ptr<Ui::BasicStrokeWidgetForm> te::qt::widgets::BasicStrokeWidget::m_ui
private

Widget form.

Definition at line 160 of file BasicStrokeWidget.h.

Referenced by BasicStrokeWidget().


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