A widget used to build a basic stroke element. More...
#include <BasicStrokeWidget.h>
Signals | |
| void | strokeChanged () |
Public Member Functions | |
| te::se::Stroke * | getStroke () 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... | |
| ColorPickerToolButton * | m_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::Stroke * | m_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... | |
A widget used to build a basic stroke element.
Definition at line 64 of file BasicStrokeWidget.h.
| te::qt::widgets::BasicStrokeWidget::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.
Definition at line 42 of file BasicStrokeWidget.cpp.
References initialize(), m_colorPicker, m_strokeCapStyleButtonGroup, m_strokeJoinStyleButtonGroup, m_ui, onColorChanged(), onStrokeCapStyleChanged(), onStrokeDashComboBoxCurrentIndexChanged(), onStrokeJoinStyleChanged(), onStrokeOpacitySliderValueChanged(), and onStrokeWidthDoubleSpinBoxValueChanged().
| te::qt::widgets::BasicStrokeWidget::~BasicStrokeWidget | ( | ) |
|
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().
| te::se::Stroke * te::qt::widgets::BasicStrokeWidget::getStroke | ( | ) | const |
Gets the configured stroke element.
Definition at line 86 of file BasicStrokeWidget.cpp.
References te::se::Stroke::clone(), and m_stroke.
Referenced by te::qt::widgets::BasicStrokeDialog::getStroke(), te::qt::widgets::LineSymbolizerWidget::LineSymbolizerWidget(), te::qt::widgets::LineSymbolizerWidget::onStrokeChanged(), te::qt::widgets::PolygonSymbolizerWidget::onStrokeChanged(), te::qt::widgets::WellKnownMarkWidget::onStrokeChanged(), te::qt::widgets::LineSymbolizerWidget::onStrokeGroupBoxToggled(), te::qt::widgets::PolygonSymbolizerWidget::onStrokeGroupBoxToggled(), te::qt::widgets::WellKnownMarkWidget::onStrokeGroupBoxToggled(), te::qt::widgets::PolygonSymbolizerWidget::PolygonSymbolizerWidget(), and te::qt::widgets::WellKnownMarkWidget::WellKnownMarkWidget().
|
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, fillStrokeDashStyleComboBox(), m_color, m_dashes, m_strokeCapStyleButtonGroup, m_strokeJoinStyleButtonGroup, m_ui, te::map::MiterJoin, te::map::RoundCap, te::map::RoundJoin, te::map::SquareCap, TE_SE_DEFAULT_STROKE_BASIC_COLOR, and updateUiStrokeColor().
Referenced by BasicStrokeWidget().
|
protectedslot |
Definition at line 249 of file BasicStrokeWidget.cpp.
References m_color, m_stroke, te::se::Stroke::setColor(), strokeChanged(), and updateUiStrokeColor().
Referenced by BasicStrokeWidget().
|
protectedslot |
Definition at line 309 of file BasicStrokeWidget.cpp.
References te::map::ButtCap, m_stroke, te::map::RoundCap, te::se::Stroke::setLineCap(), te::map::SquareCap, strokeChanged(), TE_SE_BUTT_CAP, TE_SE_ROUND_CAP, and TE_SE_SQUARE_CAP.
Referenced by BasicStrokeWidget().
|
protectedslot |
Definition at line 279 of file BasicStrokeWidget.cpp.
References m_dashes, m_stroke, te::se::Stroke::setDashArray(), and strokeChanged().
Referenced by BasicStrokeWidget().
|
protectedslot |
Definition at line 289 of file BasicStrokeWidget.cpp.
References te::map::BevelJoin, m_stroke, te::map::MiterJoin, te::map::RoundJoin, te::se::Stroke::setLineJoin(), strokeChanged(), TE_SE_BEVEL_JOIN, TE_SE_MITRE_JOIN, and TE_SE_ROUND_JOIN.
Referenced by BasicStrokeWidget().
|
protectedslot |
Definition at line 261 of file BasicStrokeWidget.cpp.
References m_color, m_stroke, te::se::Stroke::setOpacity(), strokeChanged(), and updateUiStrokeColor().
Referenced by BasicStrokeWidget().
|
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.
| stroke | A valid stroke element. |
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().
|
signal |
This signal is emitted when the internal stroke element is changed.
Referenced by onColorChanged(), onStrokeCapStyleChanged(), onStrokeDashComboBoxCurrentIndexChanged(), onStrokeJoinStyleChanged(), onStrokeOpacitySliderValueChanged(), and onStrokeWidthDoubleSpinBoxValueChanged().
|
protected |
Updates the widget form based on internal stroke element.
Definition at line 130 of file BasicStrokeWidget.cpp.
References te::color::RGBAColor::getAlpha(), te::se::GetColor(), te::se::Stroke::getDashArray(), te::se::GetDouble(), te::se::Stroke::getLineCap(), te::se::Stroke::getLineJoin(), te::color::RGBAColor::getRgba(), te::se::GetString(), te::se::Stroke::getWidth(), m_color, m_stroke, m_ui, TE_OPAQUE, TE_SE_DEFAULT_STROKE_BASIC_COLOR, updateUiCapStyle(), updateUiDashStyle(), updateUiJoinStyle(), and updateUiStrokeColor().
Referenced by setStroke().
|
protected |
Updates the widget form element used to visualize the stroke cap style.
| style | The 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().
|
protected |
Updates the widget form element used to visualize the stroke dash style.
| pattern | The stroke dash style pattern. |
Definition at line 168 of file BasicStrokeWidget.cpp.
References fillStrokeDashStyleComboBox(), m_dashes, and m_ui.
Referenced by updateUi().
|
protected |
Updates the widget form element used to visualize the stroke join style.
| style | The 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().
|
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().
|
private |
Auxiliary color attribute.
Definition at line 164 of file BasicStrokeWidget.h.
Referenced by initialize(), onColorChanged(), onStrokeOpacitySliderValueChanged(), updateUi(), and updateUiStrokeColor().
|
private |
Widget used to pick a color.
Definition at line 161 of file BasicStrokeWidget.h.
Referenced by BasicStrokeWidget(), and updateUiStrokeColor().
|
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().
|
private |
Stroke element that will be configured by this widget.
Definition at line 165 of file BasicStrokeWidget.h.
Referenced by getStroke(), onColorChanged(), onStrokeCapStyleChanged(), onStrokeDashComboBoxCurrentIndexChanged(), onStrokeJoinStyleChanged(), onStrokeOpacitySliderValueChanged(), onStrokeWidthDoubleSpinBoxValueChanged(), setStroke(), updateUi(), and ~BasicStrokeWidget().
|
private |
Button group used to control the cap styles.
Definition at line 163 of file BasicStrokeWidget.h.
Referenced by BasicStrokeWidget(), and initialize().
|
private |
Button group used to control the join styles.
Definition at line 162 of file BasicStrokeWidget.h.
Referenced by BasicStrokeWidget(), and initialize().
|
private |
Widget form.
Definition at line 160 of file BasicStrokeWidget.h.
Referenced by BasicStrokeWidget(), fillStrokeDashStyleComboBox(), initialize(), updateUi(), updateUiCapStyle(), updateUiDashStyle(), and updateUiJoinStyle().