te::qt::widgets::WellKnownGraphicWidget Class Reference

A widget used to build a graphic associate with a well-known mark element. More...

#include <WellKnownGraphicWidget.h>

Inheritance diagram for te::qt::widgets::WellKnownGraphicWidget:
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.

 WellKnownGraphicWidget (QWidget *parent=0, Qt::WindowFlags f=0)
 Constructs a well known graphic widget which is a child of parent, with widget flags set to f. More...
 
 ~WellKnownGraphicWidget ()
 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::WellKnownMarkWidgetm_markWidget
 Well known mark Widget used to configure the mark element. More...
 
std::unique_ptr< Ui::WellKnownGraphicWidgetForm > m_ui
 Widget form. More...
 

Detailed Description

A widget used to build a graphic associate with a well-known mark element.

Definition at line 53 of file WellKnownGraphicWidget.h.

Constructor & Destructor Documentation

te::qt::widgets::WellKnownGraphicWidget::~WellKnownGraphicWidget ( )
default

Destructor.

Referenced by WellKnownGraphicWidget().

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::WellKnownGraphicWidget::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 112 of file WellKnownGraphicWidget.cpp.

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

QString te::qt::widgets::WellKnownGraphicWidget::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 107 of file WellKnownGraphicWidget.cpp.

void te::qt::widgets::WellKnownGraphicWidget::onGraphicAnchorPointChanged ( const QString &  text)
protectedslot
void te::qt::widgets::WellKnownGraphicWidget::onGraphicDisplacementChanged ( const QString &  text)
protectedslot
bool te::qt::widgets::WellKnownGraphicWidget::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 74 of file WellKnownGraphicWidget.cpp.

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

void te::qt::widgets::AbstractGraphicWidget::setGraphicOpacity ( int  value)
protectedslotinherited

Member Data Documentation

te::qt::widgets::WellKnownMarkWidget* te::qt::widgets::WellKnownGraphicWidget::m_markWidget
private

Well known mark Widget used to configure the mark element.

Definition at line 103 of file WellKnownGraphicWidget.h.

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

std::unique_ptr<Ui::WellKnownGraphicWidgetForm> te::qt::widgets::WellKnownGraphicWidget::m_ui
private

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