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 
)

Constructs a basic stroke widget which is a child of parent, with widget flags set to f.

te::qt::widgets::BasicStrokeWidget::~BasicStrokeWidget ( )

Destructor.

Member Function Documentation

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

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

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.
void te::qt::widgets::BasicStrokeWidget::initialize ( )
protected

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

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

Updates the widget form based on internal stroke element.

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.
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.
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.
void te::qt::widgets::BasicStrokeWidget::updateUiStrokeColor ( )
protected

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

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.

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.

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

Button group used to control the join styles.

Definition at line 162 of file BasicStrokeWidget.h.

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

Widget form.

Definition at line 160 of file BasicStrokeWidget.h.


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