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::auto_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 | ( | ) |
Destructor.
Definition at line 70 of file BasicStrokeWidget.cpp.
|
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.
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().
|
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().
|
protectedslot |
Definition at line 249 of file BasicStrokeWidget.cpp.
Referenced by BasicStrokeWidget().
|
protectedslot |
Definition at line 309 of file BasicStrokeWidget.cpp.
References te::map::ButtCap, te::map::RoundCap, te::map::SquareCap, 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.
Referenced by BasicStrokeWidget().
|
protectedslot |
Definition at line 289 of file BasicStrokeWidget.cpp.
References te::map::BevelJoin, te::map::MiterJoin, te::map::RoundJoin, 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.
Referenced by BasicStrokeWidget().
|
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.
stroke | A valid stroke element. |
Definition at line 75 of file BasicStrokeWidget.cpp.
References te::se::Stroke::clone().
Referenced by te::qt::widgets::BasicStrokeDialog::getStroke().
|
signal |
This signal is emitted when the internal stroke element is changed.
|
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::GetDouble(), te::color::RGBAColor::getRgba(), te::se::GetString(), TE_OPAQUE, and TE_SE_DEFAULT_STROKE_BASIC_COLOR.
|
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 TE_SE_ROUND_CAP, and TE_SE_SQUARE_CAP.
|
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.
|
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 TE_SE_BEVEL_JOIN, and TE_SE_ROUND_JOIN.
|
protected |
Updates the widget form element used to visualize the stroke color.
Definition at line 163 of file BasicStrokeWidget.cpp.
|
private |
Auxiliary color attribute.
Definition at line 164 of file BasicStrokeWidget.h.
|
private |
Widget used to pick a color.
Definition at line 161 of file BasicStrokeWidget.h.
Referenced by BasicStrokeWidget().
|
private |
Predefined dash styles. TODO: it can be filled out, based on a file, etc (?)
Definition at line 166 of file BasicStrokeWidget.h.
|
private |
Stroke element that will be configured by this widget.
Definition at line 165 of file BasicStrokeWidget.h.
|
private |
Button group used to control the cap styles.
Definition at line 163 of file BasicStrokeWidget.h.
Referenced by BasicStrokeWidget().
|
private |
Button group used to control the join styles.
Definition at line 162 of file BasicStrokeWidget.h.
Referenced by BasicStrokeWidget().
|
private |