te::qt::widgets::GraphicSelectorWidget Class Reference

A widget used to select a graphic element. More...

#include <GraphicSelectorWidget.h>

Inheritance diagram for te::qt::widgets::GraphicSelectorWidget:
QWidget

Signals

void graphicChanged ()
 

Public Member Functions

te::se::GraphicgetGraphic () const
 Gets the configured graphic element. More...
 
QIcon getGraphicIcon (const QSize &size)
 Gets the current graphic icon. More...
 
void setGraphic (const te::se::Graphic *graphic)
 Sets the graphic element. More...
 
Initializer Methods

Methods related to instantiation and destruction.

 GraphicSelectorWidget (QWidget *parent=0, Qt::WindowFlags f=0)
 Constructs a graphic selector widget dialog which is a child of parent, with widget flags set to f. More...
 
 ~GraphicSelectorWidget ()
 Destructor. More...
 

Protected Slots

void onGraphicChanged ()
 
void onGraphicTypeComboBoxCurrentIndexChanged (int index)
 

Private Attributes

QStackedWidget * m_graphicWidgets
 Set of Graphic Widgets that can be used to configure the graphic element. More...
 
std::unique_ptr< Ui::GraphicSelectorWidgetForm > m_ui
 Widget form. More...
 

Detailed Description

A widget used to select a graphic element.

Definition at line 61 of file GraphicSelectorWidget.h.

Constructor & Destructor Documentation

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

Destructor.

Referenced by GraphicSelectorWidget().

Member Function Documentation

te::se::Graphic * te::qt::widgets::GraphicSelectorWidget::getGraphic ( ) const

Gets the configured graphic element.

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

Definition at line 85 of file GraphicSelectorWidget.cpp.

References te::qt::widgets::AbstractGraphicWidget::getGraphic(), and m_graphicWidgets.

Referenced by te::qt::widgets::GraphicDialog::getGraphic(), te::qt::widgets::PointSymbolizerWidget::onGraphicChanged(), and te::qt::widgets::PointSymbolizerWidget::PointSymbolizerWidget().

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

Gets the current graphic icon.

Parameters
sizeThe icon size that will be generated.
Returns
An icon that represents the graphic. i.e. a simple preview.

Definition at line 91 of file GraphicSelectorWidget.cpp.

References te::qt::widgets::AbstractGraphicWidget::getGraphicIcon(), and m_graphicWidgets.

Referenced by te::qt::widgets::GraphicDialog::getGraphicIcon().

void te::qt::widgets::GraphicSelectorWidget::graphicChanged ( )
signal

This signal is emitted when the graphic element is changed.

Referenced by GraphicSelectorWidget(), onGraphicChanged(), and onGraphicTypeComboBoxCurrentIndexChanged().

void te::qt::widgets::GraphicSelectorWidget::onGraphicChanged ( )
protectedslot

Definition at line 103 of file GraphicSelectorWidget.cpp.

References graphicChanged().

Referenced by GraphicSelectorWidget().

void te::qt::widgets::GraphicSelectorWidget::onGraphicTypeComboBoxCurrentIndexChanged ( int  index)
protectedslot

Definition at line 97 of file GraphicSelectorWidget.cpp.

References graphicChanged(), and m_graphicWidgets.

Referenced by GraphicSelectorWidget().

void te::qt::widgets::GraphicSelectorWidget::setGraphic ( const te::se::Graphic graphic)

Sets the graphic element.

Returns
The graphic element.
Note
The widget will NOT take the ownership of the given graphic.

Definition at line 67 of file GraphicSelectorWidget.cpp.

References m_graphicWidgets, m_ui, and te::qt::widgets::AbstractGraphicWidget::setGraphic().

Referenced by te::qt::widgets::GraphicDialog::getGraphic(), te::qt::widgets::GraphicDialog::setGraphic(), and te::qt::widgets::PointSymbolizerWidget::updateUi().

Member Data Documentation

QStackedWidget* te::qt::widgets::GraphicSelectorWidget::m_graphicWidgets
private

Set of Graphic Widgets that can be used to configure the graphic element.

Definition at line 123 of file GraphicSelectorWidget.h.

Referenced by getGraphic(), getGraphicIcon(), GraphicSelectorWidget(), onGraphicTypeComboBoxCurrentIndexChanged(), and setGraphic().

std::unique_ptr<Ui::GraphicSelectorWidgetForm> te::qt::widgets::GraphicSelectorWidget::m_ui
private

Widget form.

Definition at line 122 of file GraphicSelectorWidget.h.

Referenced by GraphicSelectorWidget(), and setGraphic().


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