te::qt::widgets::GlyphGraphicWidget Class Reference

A widget used to build a graphic associate with a glyph mark element. More...

#include <GlyphGraphicWidget.h>

Inheritance diagram for te::qt::widgets::GlyphGraphicWidget:
te::qt::widgets::AbstractGraphicWidget QWidget

Signals

void graphicChanged ()
 

Public Member Functions

te::se::GraphicgetGraphic () const
 Gets the configured graphic element. More...
 
Initializer Methods

Methods related to instantiation and destruction.

 GlyphGraphicWidget (QWidget *parent=0, Qt::WindowFlags f=0)
 Constructs a glyph graphic widget which is a child of parent, with widget flags set to f. More...
 
 ~GlyphGraphicWidget ()
 Destructor. More...
 
Re-implementation of Pure Virtual Method
bool setGraphic (const te::se::Graphic *graphic)
 Sets a graphic element to this widget. More...
 
QString getGraphicType () const
 Pure virtual method that should return a "user friendly" string that informs the graphic type that can be built by the widget. More...
 
QIcon getGraphicIcon (const QSize &size) const
 Pure virtual method that should return a QIcon that represents the graphic. i.e. a simple preview. More...
 

Protected Slots

void onGraphicAnchorPointChanged (const QString &text)
 
void onGraphicDisplacementChanged (const QString &text)
 
void onMarkChanged ()
 
void setGraphicAnchorPoint (const QString &ax, const QString &ay)
 
void setGraphicAngle (const QString &angle)
 
void setGraphicDisplacement (const QString &dx, const QString &dy)
 
void setGraphicOpacity (int value)
 
void setGraphicSize (const QString &size)
 

Protected Attributes

te::se::Graphicm_graphic
 Graphic element that will be configured by this widget. More...
 

Private Member Functions

void updateUi ()
 Updates the widget form based on internal graphic element. More...
 

Private Attributes

te::qt::widgets::GlyphMarkWidgetm_glyphMarkWidget
 Glyph mark widget used to configure the glyph mark element. More...
 
std::unique_ptr< Ui::GlyphGraphicWidgetForm > m_ui
 Widget form. More...
 

Detailed Description

A widget used to build a graphic associate with a glyph mark element.

Definition at line 53 of file GlyphGraphicWidget.h.

Constructor & Destructor Documentation

te::qt::widgets::GlyphGraphicWidget::GlyphGraphicWidget ( QWidget parent = 0,
Qt::WindowFlags  f = 0 
)
te::qt::widgets::GlyphGraphicWidget::~GlyphGraphicWidget ( )
default

Destructor.

Referenced by GlyphGraphicWidget().

Member Function Documentation

te::se::Graphic * te::qt::widgets::AbstractGraphicWidget::getGraphic ( ) const
inherited

Gets the configured graphic element.

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

Definition at line 44 of file AbstractGraphicWidget.cpp.

References te::se::Graphic::clone(), and te::qt::widgets::AbstractGraphicWidget::m_graphic.

Referenced by te::qt::widgets::GraphicSelectorWidget::getGraphic().

QIcon te::qt::widgets::GlyphGraphicWidget::getGraphicIcon ( const QSize &  size) const
virtual

Pure virtual method that should return a QIcon that represents the graphic. i.e. a simple preview.

Implements te::qt::widgets::AbstractGraphicWidget.

Definition at line 105 of file GlyphGraphicWidget.cpp.

References te::common::Free(), te::qt::widgets::GetImage(), te::common::Singleton< MarkRendererManager >::getInstance(), te::qt::widgets::GlyphMarkWidget::getMark(), and m_glyphMarkWidget.

QString te::qt::widgets::GlyphGraphicWidget::getGraphicType ( ) const
virtual

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

Implements te::qt::widgets::AbstractGraphicWidget.

Definition at line 100 of file GlyphGraphicWidget.cpp.

void te::qt::widgets::GlyphGraphicWidget::onGraphicAnchorPointChanged ( const QString &  text)
protectedslot
void te::qt::widgets::GlyphGraphicWidget::onGraphicDisplacementChanged ( const QString &  text)
protectedslot
bool te::qt::widgets::GlyphGraphicWidget::setGraphic ( const te::se::Graphic graphic)
virtual

Sets a graphic element to this widget.

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

Implements te::qt::widgets::AbstractGraphicWidget.

Definition at line 70 of file GlyphGraphicWidget.cpp.

References te::se::Graphic::clone(), te::se::Graphic::getMarks(), te::se::Mark::getWellKnownName(), m_glyphMarkWidget, te::qt::widgets::AbstractGraphicWidget::m_graphic, te::qt::widgets::GlyphMarkWidget::setMark(), and updateUi().

Member Data Documentation

te::qt::widgets::GlyphMarkWidget* te::qt::widgets::GlyphGraphicWidget::m_glyphMarkWidget
private

Glyph mark widget used to configure the glyph mark element.

Definition at line 103 of file GlyphGraphicWidget.h.

Referenced by getGraphicIcon(), GlyphGraphicWidget(), onMarkChanged(), and setGraphic().

std::unique_ptr<Ui::GlyphGraphicWidgetForm> te::qt::widgets::GlyphGraphicWidget::m_ui
private

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