te::qt::widgets::SymbolSelectorDialog Class Reference

A dialog used to select a specific symbol. More...

#include <SymbolSelectorDialog.h>

Inheritance diagram for te::qt::widgets::SymbolSelectorDialog:

Public Member Functions

SymbolgetSymbol () const
 Gets the selected symbol. More...
 
Initializer Methods

Methods related to instantiation and destruction.

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

Static Public Member Functions

static SymbolgetSymbol (QWidget *parent, const QString &title="")
 Pops up a modal symbol selector dialog with the given window title, lets the user select a symbol, and returns that symbol. More...
 

Private Types

enum  NodeType { LIBRARY = 0, SYMBOL = 1 }
 Auxiliary internal enumeration to control the tree nodes. More...
 

Private Slots

void onCurrentItemChanged (QTreeWidgetItem *current, QTreeWidgetItem *previous)
 
void onLoadSymbolLibraryPushButtonPressed ()
 
void onSearchLineEditTextChanged (const QString &text)
 
void onShowSymbolInfoPushButtonPressed ()
 

Private Member Functions

void filter (const QList< QTreeWidgetItem *> &items)
 Auxiliary internal method to filter the symbols. More...
 
QString formatSymbolInfo (const SymbolInfo &info) const
 Auxiliary internal method to format a symbol info to be used on tool tips. More...
 
SymbolgetSelectedSymbol () const
 Auxiliary internal method that returns the selected symbol. More...
 
SymbolgetSymbolFromItem (QTreeWidgetItem *item) const
 Auxiliary internal method that returns the symbol given a list widget item. More...
 
void initialize ()
 Initialize the dialog. More...
 

Private Attributes

SymbolPreviewWidgetm_preview
 Preview Widget used to visualize the symbol. More...
 
std::unique_ptr< Ui::SymbolSelectorDialogForm > m_ui
 Dialog form. More...
 

Detailed Description

A dialog used to select a specific symbol.

Definition at line 58 of file SymbolSelectorDialog.h.

Member Enumeration Documentation

◆ NodeType

Auxiliary internal enumeration to control the tree nodes.

Enumerator
LIBRARY 

Library root node.

SYMBOL 

Symbol node.

Definition at line 69 of file SymbolSelectorDialog.h.

Constructor & Destructor Documentation

◆ SymbolSelectorDialog()

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

Constructs a symbol selector dialog which is a child of parent, with widget flags set to f.

◆ ~SymbolSelectorDialog()

te::qt::widgets::SymbolSelectorDialog::~SymbolSelectorDialog ( )

Destructor.

Member Function Documentation

◆ filter()

void te::qt::widgets::SymbolSelectorDialog::filter ( const QList< QTreeWidgetItem *> &  items)
private

Auxiliary internal method to filter the symbols.

◆ formatSymbolInfo()

QString te::qt::widgets::SymbolSelectorDialog::formatSymbolInfo ( const SymbolInfo info) const
private

Auxiliary internal method to format a symbol info to be used on tool tips.

◆ getSelectedSymbol()

Symbol* te::qt::widgets::SymbolSelectorDialog::getSelectedSymbol ( ) const
private

Auxiliary internal method that returns the selected symbol.

◆ getSymbol() [1/2]

static Symbol* te::qt::widgets::SymbolSelectorDialog::getSymbol ( QWidget *  parent,
const QString &  title = "" 
)
static

Pops up a modal symbol selector dialog with the given window title, lets the user select a symbol, and returns that symbol.

Parameters
parentDialog parent.
titleDialog title.
Note
The caller will take the ownership of the returned symbol.
It returns a NULL pointr if the user cancels the dialog.
It return a NULL pointer if there is not a selected symbol.

◆ getSymbol() [2/2]

Symbol* te::qt::widgets::SymbolSelectorDialog::getSymbol ( ) const

Gets the selected symbol.

Returns
The selected fill element.
Note
The caller will take the ownership of the returned symbol.
It return a NULL pointer if there is not a selected symbol.

◆ getSymbolFromItem()

Symbol* te::qt::widgets::SymbolSelectorDialog::getSymbolFromItem ( QTreeWidgetItem *  item) const
private

Auxiliary internal method that returns the symbol given a list widget item.

◆ initialize()

void te::qt::widgets::SymbolSelectorDialog::initialize ( )
private

Initialize the dialog.

◆ onCurrentItemChanged

void te::qt::widgets::SymbolSelectorDialog::onCurrentItemChanged ( QTreeWidgetItem *  current,
QTreeWidgetItem *  previous 
)
privateslot

◆ onLoadSymbolLibraryPushButtonPressed

void te::qt::widgets::SymbolSelectorDialog::onLoadSymbolLibraryPushButtonPressed ( )
privateslot

◆ onSearchLineEditTextChanged

void te::qt::widgets::SymbolSelectorDialog::onSearchLineEditTextChanged ( const QString &  text)
privateslot

◆ onShowSymbolInfoPushButtonPressed

void te::qt::widgets::SymbolSelectorDialog::onShowSymbolInfoPushButtonPressed ( )
privateslot

Member Data Documentation

◆ m_preview

SymbolPreviewWidget* te::qt::widgets::SymbolSelectorDialog::m_preview
private

Preview Widget used to visualize the symbol.

Definition at line 143 of file SymbolSelectorDialog.h.

◆ m_ui

std::unique_ptr<Ui::SymbolSelectorDialogForm> te::qt::widgets::SymbolSelectorDialog::m_ui
private

Dialog form.

Definition at line 142 of file SymbolSelectorDialog.h.


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