All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::auto_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

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

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.

Definition at line 45 of file SymbolSelectorDialog.cpp.

References initialize(), m_preview, m_ui, onCurrentItemChanged(), onLoadSymbolLibraryPushButtonPressed(), onSearchLineEditTextChanged(), and onShowSymbolInfoPushButtonPressed().

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

Destructor.

Definition at line 72 of file SymbolSelectorDialog.cpp.

Member Function Documentation

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

Auxiliary internal method to filter the symbols.

Definition at line 195 of file SymbolSelectorDialog.cpp.

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.

Definition at line 250 of file SymbolSelectorDialog.cpp.

References te::qt::widgets::SymbolInfo::m_author, te::qt::widgets::SymbolInfo::m_description, te::qt::widgets::SymbolInfo::m_name, and te::qt::widgets::SymbolInfo::m_tags.

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

Auxiliary internal method that returns the selected symbol.

Definition at line 213 of file SymbolSelectorDialog.cpp.

te::qt::widgets::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.

Definition at line 76 of file SymbolSelectorDialog.cpp.

References getSymbol().

Referenced by getSymbol().

te::qt::widgets::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.

Definition at line 89 of file SymbolSelectorDialog.cpp.

References te::qt::widgets::Symbol::clone().

Referenced by te::qt::widgets::StyleControllerWidget::onLibraryManagerClicked().

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

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

Definition at line 223 of file SymbolSelectorDialog.cpp.

References te::qt::widgets::SymbolLibraryManager::findByName(), and te::common::Singleton< SymbolLibraryManager >::getInstance().

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

Definition at line 99 of file SymbolSelectorDialog.cpp.

Referenced by SymbolSelectorDialog().

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

Definition at line 142 of file SymbolSelectorDialog.cpp.

Referenced by SymbolSelectorDialog().

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

Member Data Documentation

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

Preview Widget used to visualize the symbol.

Definition at line 143 of file SymbolSelectorDialog.h.

Referenced by SymbolSelectorDialog().

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

Dialog form.

Definition at line 142 of file SymbolSelectorDialog.h.

Referenced by SymbolSelectorDialog().


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