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:
QWidget

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::unique_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.

References m_stroke.

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(), line, m_dashes, and m_ui.

Referenced by initialize(), and updateUiDashStyle().

void te::qt::widgets::BasicStrokeWidget::initialize ( )
protected
void te::qt::widgets::BasicStrokeWidget::onColorChanged ( const QColor &  color)
protectedslot
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.

References m_dashes, m_stroke, te::se::Stroke::setDashArray(), and strokeChanged().

Referenced by BasicStrokeWidget().

void te::qt::widgets::BasicStrokeWidget::onStrokeJoinStyleChanged ( int  style)
protectedslot
void te::qt::widgets::BasicStrokeWidget::onStrokeOpacitySliderValueChanged ( int  value)
protectedslot
void te::qt::widgets::BasicStrokeWidget::onStrokeWidthDoubleSpinBoxValueChanged ( const QString &  text)
protectedslot

Definition at line 273 of file BasicStrokeWidget.cpp.

References m_stroke, te::se::Stroke::setWidth(), and strokeChanged().

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(), m_stroke, and updateUi().

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

void te::qt::widgets::BasicStrokeWidget::strokeChanged ( )
signal
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 m_ui, TE_SE_ROUND_CAP, and TE_SE_SQUARE_CAP.

Referenced by updateUi().

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.

References fillStrokeDashStyleComboBox(), m_dashes, and m_ui.

Referenced by updateUi().

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 m_ui, TE_SE_BEVEL_JOIN, and TE_SE_ROUND_JOIN.

Referenced by updateUi().

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.

References m_color, m_colorPicker, and te::qt::widgets::ColorPickerToolButton::setColor().

Referenced by initialize(), onColorChanged(), onStrokeOpacitySliderValueChanged(), and updateUi().

Member Data Documentation

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

Auxiliary color attribute.

Definition at line 164 of file BasicStrokeWidget.h.

Referenced by initialize(), onColorChanged(), onStrokeOpacitySliderValueChanged(), updateUi(), and updateUiStrokeColor().

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(), and updateUiStrokeColor().

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.

Referenced by fillStrokeDashStyleComboBox(), initialize(), onStrokeDashComboBoxCurrentIndexChanged(), and updateUiDashStyle().

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(), and initialize().

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(), and initialize().

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

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