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

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

#include <BasicFillWidget.h>

Inheritance diagram for te::qt::widgets::BasicFillWidget:
te::qt::widgets::AbstractFillWidget

Signals

void fillChanged ()
 

Public Member Functions

Initializer Methods

Methods related to instantiation and destruction.

 BasicFillWidget (QWidget *parent=0, Qt::WindowFlags f=0)
 Constructs a basic fill widget which is a child of parent, with widget flags set to f. More...
 
 ~BasicFillWidget ()
 Destructor. More...
 
Re-implementation of Pure Virtual Method
bool setFill (const te::se::Fill *fill)
 Sets a fill element to this widget. More...
 
te::se::FillgetFill () const
 Gets the configured fill element. More...
 
QString getFillType () const
 Pure virtual method that should return a "user friendly" string that informs the fill type that can be built by the widget. More...
 

Protected Slots

void onColorChanged (const QColor &color)
 
void onFillOpacitySliderValueChanged (int value)
 

Protected Member Functions

void initialize ()
 Internal method to initialize the widget (e.g.: color, combos, icons, etc.) More...
 
void updateUi ()
 Updates the widget form based on internal fill element. More...
 
void updateUiFillColor ()
 Updates the widget form element used to visualize the fill color. More...
 

Private Attributes

QColor m_color
 Auxiliary color attribute. More...
 
ColorPickerToolButtonm_colorPicker
 Widget used to pick a color. More...
 
te::se::Fillm_fill
 Fill element that will be configured by this widget. More...
 
std::auto_ptr
< Ui::BasicFillWidgetForm > 
m_ui
 Widget form. More...
 

Detailed Description

A widget used to build a basic fill element.

See also
AbstractFillWidget, GraphicFillWidget

Definition at line 61 of file BasicFillWidget.h.

Constructor & Destructor Documentation

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

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

Definition at line 36 of file BasicFillWidget.cpp.

References initialize(), m_colorPicker, m_ui, onColorChanged(), and onFillOpacitySliderValueChanged().

te::qt::widgets::BasicFillWidget::~BasicFillWidget ( )

Destructor.

Definition at line 60 of file BasicFillWidget.cpp.

Member Function Documentation

void te::qt::widgets::BasicFillWidget::fillChanged ( )
signal

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

te::se::Fill * te::qt::widgets::BasicFillWidget::getFill ( ) const
virtual

Gets the configured fill element.

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

Implements te::qt::widgets::AbstractFillWidget.

Definition at line 83 of file BasicFillWidget.cpp.

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

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

QString te::qt::widgets::BasicFillWidget::getFillType ( ) const
virtual

Pure virtual method that should return a "user friendly" string that informs the fill type that can be built by the widget.

Implements te::qt::widgets::AbstractFillWidget.

Definition at line 88 of file BasicFillWidget.cpp.

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

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

Definition at line 93 of file BasicFillWidget.cpp.

References TE_SE_DEFAULT_FILL_BASIC_COLOR.

Referenced by BasicFillWidget().

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

Definition at line 118 of file BasicFillWidget.cpp.

Referenced by BasicFillWidget().

void te::qt::widgets::BasicFillWidget::onFillOpacitySliderValueChanged ( int  value)
protectedslot

Definition at line 130 of file BasicFillWidget.cpp.

Referenced by BasicFillWidget().

bool te::qt::widgets::BasicFillWidget::setFill ( const te::se::Fill fill)
virtual

Sets a fill element to this widget.

Parameters
fillA valid fill element.
Returns
It return true if the widget can deal with the given fill. Otherwise, it returns false.
Note
The widget will NOT take the ownership of the given fill.
The widget form will be update based on given fill parameters.

Implements te::qt::widgets::AbstractFillWidget.

Definition at line 65 of file BasicFillWidget.cpp.

References te::se::Fill::clone(), and te::se::Fill::getGraphicFill().

Referenced by te::qt::widgets::BasicFillDialog::getFill().

void te::qt::widgets::BasicFillWidget::updateUi ( )
protected

Updates the widget form based on internal fill element.

Definition at line 100 of file BasicFillWidget.cpp.

References te::color::RGBAColor::getAlpha(), te::se::GetColor(), te::color::RGBAColor::getRgba(), TE_OPAQUE, and TE_SE_DEFAULT_FILL_BASIC_COLOR.

void te::qt::widgets::BasicFillWidget::updateUiFillColor ( )
protected

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

Definition at line 113 of file BasicFillWidget.cpp.

Member Data Documentation

QColor te::qt::widgets::BasicFillWidget::m_color
private

Auxiliary color attribute.

Definition at line 121 of file BasicFillWidget.h.

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

Widget used to pick a color.

Definition at line 120 of file BasicFillWidget.h.

Referenced by BasicFillWidget().

te::se::Fill* te::qt::widgets::BasicFillWidget::m_fill
private

Fill element that will be configured by this widget.

Definition at line 122 of file BasicFillWidget.h.

std::auto_ptr<Ui::BasicFillWidgetForm> te::qt::widgets::BasicFillWidget::m_ui
private

Widget form.

Definition at line 119 of file BasicFillWidget.h.

Referenced by BasicFillWidget().


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