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

A dialog used to create or edit a specific symbol. More...

#include <SymbolSelectorDialog.h>

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

Private Types

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

Initializer Methods

Methods related to instantiation and destruction.

std::unique_ptr< Ui::SymbolSelectorDialogForm > m_ui
 Dialog form. More...
 
SymbolPreviewWidgetm_preview
 Preview Widget used to visualize the symbol. More...
 
std::vector< std::string > m_fieldsNames
 Dataset fields names for text symbolizer (no geometry) More...
 
QTreeWidgetItem * m_currentDragDropItem
 
 SymbolSelectorDialog (const std::vector< std::string > &fieldsNames, 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...
 
virtual ~SymbolSelectorDialog ()
 Destructor. More...
 
SymbolgetSelectedSymbol () const
 Auxiliary internal method that returns the selected symbol. More...
 
SymbolgetSymbol () const
 Gets the selected symbol. More...
 
void onCurrentItemChanged (QTreeWidgetItem *current, QTreeWidgetItem *previous)
 
void onShowSymbolInfoPushButtonPressed ()
 
void onImportButtonPressed ()
 
void onExportButtonPressed ()
 
void onSearchLineEditTextChanged (const QString &text)
 
void onCreateSymbolPushButtonClicked ()
 
void onEditSymbolPushButtonClicked ()
 
void onRemoveSymbolPushButtonClicked ()
 
void onCreateGroupPushButtonClicked ()
 
void onRenameGroupPushButtonClicked ()
 
void onRemoveGroupPushButtonClicked ()
 
void onOkPushButtonClicked ()
 
void onClosePushButtonClicked ()
 
void onHelpPushButtonClicked ()
 
void onDropEvent ()
 
void onDragEnterEvent ()
 
void initialize ()
 Initialize the dialog. More...
 
void filter (const QList< QTreeWidgetItem *> &items)
 Auxiliary internal method to filter the symbols. More...
 
SymbolgetSymbolFromItem (QTreeWidgetItem *item) const
 Auxiliary internal method that returns the symbol given a list widget item. More...
 
QString formatSymbolInfo (const SymbolInfo &info) const
 Auxiliary internal method to format a symbol info to be used on tool tips. More...
 
bool addSymbol (Symbol *symbol, const QString &groupParentId)
 Add new symbol to a symbol library. More...
 
bool updateCurrentSymbol (Symbol *symbol)
 Update the current selected symbol. More...
 
bool removeSymbol (Symbol *symbol)
 Remove a symbol from a symbol library . More...
 
bool eraseSymbol (Symbol *symbol)
 Remove a symbol from a symbol library . More...
 
bool eraseCurrentSymbol ()
 Remove the current selected symbol from a symbol library. More...
 
bool addGroup (const QString &groupName, const QString &groupParentId)
 Add new symbol to a symbol library. More...
 
bool updateCurrentGroup (const QString &newGroupName, const QString &groupId)
 Update the current selected symbol. More...
 
bool eraseGroup (const QString &groupId)
 Remove a symbol from a symbol library . More...
 
bool eraseCurrentGroup ()
 Remove the current selected symbol from a symbol library. More...
 
QTreeWidgetItem * getSelectedItem () const
 Get the current selected symbol. More...
 
void buildTree (SymbolNode *node, QTreeWidgetItem *parent)
 
QTreeWidgetItem * createItemFromGroup (SymbolNode *node, QTreeWidgetItem *parent=nullptr)
 
QTreeWidgetItem * createItemFromGroup (SymbolNode *node, QTreeWidget *parent)
 
QTreeWidgetItem * createItemFromSymbol (Symbol *symbol, QTreeWidgetItem *parent=nullptr)
 
QTreeWidgetItem * createItemFromSymbol (Symbol *symbol, QTreeWidget *parent)
 
void configItemFromSymbol (Symbol *symbol, QTreeWidgetItem *item)
 
void enableSymbolItem (bool enable)
 
void enableGroupItem (bool enable)
 
QTreeWidgetItem * getCurrentGroupItem ()
 
QString getCurrentGroupItemID ()
 
QTreeWidgetItem * searchParentGroup (QTreeWidgetItem *item)
 
QString getSelectedItemID ()
 
bool isRootItem (QTreeWidgetItem *item)
 

Detailed Description

A dialog used to create or edit a specific symbol.

A dialog used to select a specific symbol.

Definition at line 73 of file SymbolSelectorDialog.h.

Member Enumeration Documentation

◆ NodeType

Auxiliary internal enumeration to control the tree nodes.

Enumerator
GROUP 

Library root node.

SYMBOL 

Symbol node.

Definition at line 84 of file SymbolSelectorDialog.h.

Constructor & Destructor Documentation

◆ SymbolSelectorDialog()

te::qt::widgets::SymbolSelectorDialog::SymbolSelectorDialog ( const std::vector< std::string > &  fieldsNames,
QWidget *  parent = 0,
Qt::WindowFlags  f = 0 
)

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

Note
field names from dataset for text symbolizer (no geometry)

◆ ~SymbolSelectorDialog()

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

Destructor.

Member Function Documentation

◆ addGroup()

bool te::qt::widgets::SymbolSelectorDialog::addGroup ( const QString &  groupName,
const QString &  groupParentId 
)
private

Add new symbol to a symbol library.

◆ addSymbol()

bool te::qt::widgets::SymbolSelectorDialog::addSymbol ( Symbol symbol,
const QString &  groupParentId 
)
private

Add new symbol to a symbol library.

◆ buildTree()

void te::qt::widgets::SymbolSelectorDialog::buildTree ( SymbolNode node,
QTreeWidgetItem *  parent 
)
private

◆ configItemFromSymbol()

void te::qt::widgets::SymbolSelectorDialog::configItemFromSymbol ( Symbol symbol,
QTreeWidgetItem *  item 
)
private

◆ createItemFromGroup() [1/2]

QTreeWidgetItem* te::qt::widgets::SymbolSelectorDialog::createItemFromGroup ( SymbolNode node,
QTreeWidgetItem *  parent = nullptr 
)
private

◆ createItemFromGroup() [2/2]

QTreeWidgetItem* te::qt::widgets::SymbolSelectorDialog::createItemFromGroup ( SymbolNode node,
QTreeWidget *  parent 
)
private

◆ createItemFromSymbol() [1/2]

QTreeWidgetItem* te::qt::widgets::SymbolSelectorDialog::createItemFromSymbol ( Symbol symbol,
QTreeWidgetItem *  parent = nullptr 
)
private

◆ createItemFromSymbol() [2/2]

QTreeWidgetItem* te::qt::widgets::SymbolSelectorDialog::createItemFromSymbol ( Symbol symbol,
QTreeWidget *  parent 
)
private

◆ enableGroupItem()

void te::qt::widgets::SymbolSelectorDialog::enableGroupItem ( bool  enable)
private

◆ enableSymbolItem()

void te::qt::widgets::SymbolSelectorDialog::enableSymbolItem ( bool  enable)
private

◆ eraseCurrentGroup()

bool te::qt::widgets::SymbolSelectorDialog::eraseCurrentGroup ( )
private

Remove the current selected symbol from a symbol library.

Note
The symbol is removed, but the pointer is not deleted.

◆ eraseCurrentSymbol()

bool te::qt::widgets::SymbolSelectorDialog::eraseCurrentSymbol ( )
private

Remove the current selected symbol from a symbol library.

Note
The symbol is removed, but the pointer is not deleted.

◆ eraseGroup()

bool te::qt::widgets::SymbolSelectorDialog::eraseGroup ( const QString &  groupId)
private

Remove a symbol from a symbol library .

Note
The symbol is removed, but the pointer is not deleted.

◆ eraseSymbol()

bool te::qt::widgets::SymbolSelectorDialog::eraseSymbol ( Symbol symbol)
private

Remove a symbol from a symbol library .

Note
The symbol is removed, but the pointer is not deleted.

◆ 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.

◆ getCurrentGroupItem()

QTreeWidgetItem* te::qt::widgets::SymbolSelectorDialog::getCurrentGroupItem ( )
private

◆ getCurrentGroupItemID()

QString te::qt::widgets::SymbolSelectorDialog::getCurrentGroupItemID ( )
private

◆ getSelectedItem()

QTreeWidgetItem* te::qt::widgets::SymbolSelectorDialog::getSelectedItem ( ) const
private

Get the current selected symbol.

◆ getSelectedItemID()

QString te::qt::widgets::SymbolSelectorDialog::getSelectedItemID ( )
private

◆ getSelectedSymbol()

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

Auxiliary internal method that returns the selected symbol.

◆ getSymbol()

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.

◆ isRootItem()

bool te::qt::widgets::SymbolSelectorDialog::isRootItem ( QTreeWidgetItem *  item)
private

◆ onClosePushButtonClicked

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

◆ onCreateGroupPushButtonClicked

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

◆ onCreateSymbolPushButtonClicked

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

◆ onCurrentItemChanged

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

◆ onDragEnterEvent

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

◆ onDropEvent

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

◆ onEditSymbolPushButtonClicked

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

◆ onExportButtonPressed

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

◆ onHelpPushButtonClicked

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

◆ onImportButtonPressed

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

◆ onOkPushButtonClicked

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

◆ onRemoveGroupPushButtonClicked

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

◆ onRemoveSymbolPushButtonClicked

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

◆ onRenameGroupPushButtonClicked

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

◆ onSearchLineEditTextChanged

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

◆ onShowSymbolInfoPushButtonPressed

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

◆ removeSymbol()

bool te::qt::widgets::SymbolSelectorDialog::removeSymbol ( Symbol symbol)
private

Remove a symbol from a symbol library .

Note
The symbol is removed, but the pointer is not deleted.

◆ searchParentGroup()

QTreeWidgetItem* te::qt::widgets::SymbolSelectorDialog::searchParentGroup ( QTreeWidgetItem *  item)
private

◆ updateCurrentGroup()

bool te::qt::widgets::SymbolSelectorDialog::updateCurrentGroup ( const QString &  newGroupName,
const QString &  groupId 
)
private

Update the current selected symbol.

Note
The symbol with the old state will be removed, and a new one with the same id and name will be added to the library.

◆ updateCurrentSymbol()

bool te::qt::widgets::SymbolSelectorDialog::updateCurrentSymbol ( Symbol symbol)
private

Update the current selected symbol.

Note
The symbol with the old state will be removed, and a new one with the same id and name will be added to the library.

Member Data Documentation

◆ m_currentDragDropItem

QTreeWidgetItem* te::qt::widgets::SymbolSelectorDialog::m_currentDragDropItem
private

Definition at line 261 of file SymbolSelectorDialog.h.

◆ m_fieldsNames

std::vector<std::string> te::qt::widgets::SymbolSelectorDialog::m_fieldsNames
private

Dataset fields names for text symbolizer (no geometry)

Definition at line 260 of file SymbolSelectorDialog.h.

◆ m_preview

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

Preview Widget used to visualize the symbol.

Definition at line 259 of file SymbolSelectorDialog.h.

◆ m_ui

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

Dialog form.

Definition at line 258 of file SymbolSelectorDialog.h.


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