All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::qt::widgets::LayerTreeView Class Reference

A tree view for the layers of an application. More...

#include <LayerTreeView.h>

Inheritance diagram for te::qt::widgets::LayerTreeView:

Classes

class  Impl
 LayerTreeView implementation. More...
 

Public Types

enum  ContextMenuSelectionType { NO_ITEM_SELECTED, UNIQUE_ITEM_SELECTED, MULTIPLE_ITEMS_SELECTED }
 

Public Slots

void onSelectedLayersChanged (const QItemSelection &selected, const QItemSelection &deselected)
 

Signals

void activated (te::qt::widgets::AbstractTreeItem *item)
 
void clicked (te::qt::widgets::AbstractTreeItem *item)
 
void doubleClicked (te::qt::widgets::AbstractTreeItem *item)
 
void entered (te::qt::widgets::AbstractTreeItem *item)
 
void pressed (te::qt::widgets::AbstractTreeItem *item)
 
void selectedLayersChanged (const std::list< te::map::AbstractLayerPtr > &selectedLayers)
 
void visibilityChanged (const te::map::AbstractLayerPtr &layer)
 

Public Member Functions

void add (QAction *action, const std::string &menu="", const std::string &itemType="", ContextMenuSelectionType menuSelectionType=te::qt::widgets::LayerTreeView::UNIQUE_ITEM_SELECTED)
 It adds the action to a specified menu of a given item type when a context menu is displayed. More...
 
std::list
< te::map::AbstractLayerPtr
getSelectedAndVisibleSingleLayers () const
 It gets the single layers that are selected and visible in the tree view. More...
 
std::list< AbstractTreeItem * > getSelectedItems () const
 It gets the items that are selected in the tree view. More...
 
std::list< AbstractTreeItem * > getSelectedLayerItems () const
 It gets the single and folder layer items that are selected in the tree view. More...
 
std::list< AbstractTreeItem * > getSelectedSingleLayerItems () const
 It gets the single layer items that are selected in the tree view. More...
 
std::list
< te::map::AbstractLayerPtr
getSelectedSingleLayers () const
 It gets the single layers that are selected in the view. More...
 
 LayerTreeView (QWidget *parent=0)
 Constructor. More...
 
void remove (QAction *action)
 It removes the action from the list of context menu. More...
 
 ~LayerTreeView ()
 Destructor. More...
 

Protected Slots

void onItemActivated (const QModelIndex &index)
 
void onItemClicked (const QModelIndex &index)
 
void onItemDoubleClicked (const QModelIndex &index)
 
void onItemEntered (const QModelIndex &index)
 
void onItemPressed (const QModelIndex &index)
 

Protected Member Functions

void contextMenuEvent (QContextMenuEvent *e)
 
void dragEnterEvent (QDragEnterEvent *e)
 
void dragLeaveEvent (QDragLeaveEvent *e)
 
void dragMoveEvent (QDragMoveEvent *e)
 
void dropEvent (QDropEvent *e)
 

Private Attributes

Implm_pImpl
 The tree view implementation. More...
 

Detailed Description

A tree view for the layers of an application.

See also
LayerExplorer, LayerTreeModel

Definition at line 63 of file LayerTreeView.h.

Member Enumeration Documentation

Enumerator
NO_ITEM_SELECTED 
UNIQUE_ITEM_SELECTED 
MULTIPLE_ITEMS_SELECTED 

Definition at line 69 of file LayerTreeView.h.

Constructor & Destructor Documentation

te::qt::widgets::LayerTreeView::LayerTreeView ( QWidget *  parent = 0)
te::qt::widgets::LayerTreeView::~LayerTreeView ( )

Destructor.

Definition at line 272 of file LayerTreeView.cpp.

Member Function Documentation

void te::qt::widgets::LayerTreeView::activated ( te::qt::widgets::AbstractTreeItem item)
signal

Referenced by LayerTreeView().

void te::qt::widgets::LayerTreeView::add ( QAction *  action,
const std::string &  menu = "",
const std::string &  itemType = "",
ContextMenuSelectionType  menuSelectionType = te::qt::widgets::LayerTreeView::UNIQUE_ITEM_SELECTED 
)

It adds the action to a specified menu of a given item type when a context menu is displayed.

Parameters
actionThe action to be associated to the context menu.
menuThe name of a submenu, using a dot separator notation. If omitted, the action will be set on a top menu item.
itemTypeIf omitted the action will be set to all item types.
menuSelectionTypeThe selection type of the context menu.
Note
LayerTreeView will not take the ownership of the action.

Definition at line 386 of file LayerTreeView.cpp.

Referenced by te::qt::af::BaseApplication::makeDialog().

void te::qt::widgets::LayerTreeView::clicked ( te::qt::widgets::AbstractTreeItem item)
signal

Referenced by LayerTreeView().

void te::qt::widgets::LayerTreeView::contextMenuEvent ( QContextMenuEvent *  e)
protected

Definition at line 534 of file LayerTreeView.cpp.

void te::qt::widgets::LayerTreeView::doubleClicked ( te::qt::widgets::AbstractTreeItem item)
signal

Referenced by LayerTreeView().

void te::qt::widgets::LayerTreeView::dragEnterEvent ( QDragEnterEvent *  e)
protected

Definition at line 482 of file LayerTreeView.cpp.

void te::qt::widgets::LayerTreeView::dragLeaveEvent ( QDragLeaveEvent *  e)
protected

Definition at line 503 of file LayerTreeView.cpp.

void te::qt::widgets::LayerTreeView::dragMoveEvent ( QDragMoveEvent *  e)
protected

Definition at line 491 of file LayerTreeView.cpp.

void te::qt::widgets::LayerTreeView::dropEvent ( QDropEvent *  e)
protected

Definition at line 512 of file LayerTreeView.cpp.

void te::qt::widgets::LayerTreeView::entered ( te::qt::widgets::AbstractTreeItem item)
signal

Referenced by LayerTreeView().

std::list< te::map::AbstractLayerPtr > te::qt::widgets::LayerTreeView::getSelectedAndVisibleSingleLayers ( ) const

It gets the single layers that are selected and visible in the tree view.

Returns
The list of single layers that are selected and visible in the tree view.

Definition at line 350 of file LayerTreeView.cpp.

References te::map::VISIBLE.

std::list< te::qt::widgets::AbstractTreeItem * > te::qt::widgets::LayerTreeView::getSelectedItems ( ) const

It gets the items that are selected in the tree view.

Returns
The list of items that are selected in the tree view.

Definition at line 277 of file LayerTreeView.cpp.

Referenced by te::qt::widgets::LayerTreeView::Impl::showContextMenu().

std::list< te::qt::widgets::AbstractTreeItem * > te::qt::widgets::LayerTreeView::getSelectedLayerItems ( ) const

It gets the single and folder layer items that are selected in the tree view.

Returns
The list of single and folder layer items that are selected in the tree view.

Definition at line 296 of file LayerTreeView.cpp.

References te::qt::widgets::AbstractTreeItem::getLayer().

std::list< te::qt::widgets::AbstractTreeItem * > te::qt::widgets::LayerTreeView::getSelectedSingleLayerItems ( ) const

It gets the single layer items that are selected in the tree view.

Returns
The list of single layer items that are selected in the tree view.

Definition at line 314 of file LayerTreeView.cpp.

References te::qt::widgets::AbstractTreeItem::getItemType(), and te::qt::widgets::AbstractTreeItem::getLayer().

std::list< te::map::AbstractLayerPtr > te::qt::widgets::LayerTreeView::getSelectedSingleLayers ( ) const

It gets the single layers that are selected in the view.

Returns
The list of single layers that are selected in the view.

Definition at line 332 of file LayerTreeView.cpp.

void te::qt::widgets::LayerTreeView::onItemActivated ( const QModelIndex &  index)
protectedslot

Definition at line 399 of file LayerTreeView.cpp.

Referenced by LayerTreeView().

void te::qt::widgets::LayerTreeView::onItemClicked ( const QModelIndex &  index)
protectedslot
void te::qt::widgets::LayerTreeView::onItemDoubleClicked ( const QModelIndex &  index)
protectedslot

Definition at line 456 of file LayerTreeView.cpp.

Referenced by LayerTreeView().

void te::qt::widgets::LayerTreeView::onItemEntered ( const QModelIndex &  index)
protectedslot

Definition at line 463 of file LayerTreeView.cpp.

Referenced by LayerTreeView().

void te::qt::widgets::LayerTreeView::onItemPressed ( const QModelIndex &  index)
protectedslot
void te::qt::widgets::LayerTreeView::onSelectedLayersChanged ( const QItemSelection &  selected,
const QItemSelection &  deselected 
)
slot

Definition at line 367 of file LayerTreeView.cpp.

void te::qt::widgets::LayerTreeView::pressed ( te::qt::widgets::AbstractTreeItem item)
signal

Referenced by LayerTreeView().

void te::qt::widgets::LayerTreeView::remove ( QAction *  action)

It removes the action from the list of context menu.

Parameters
actionThe action to be removed from the context menu.
Note
The LayerTreeView will not destroy the action, it will only detach it from the widget.

Definition at line 394 of file LayerTreeView.cpp.

void te::qt::widgets::LayerTreeView::selectedLayersChanged ( const std::list< te::map::AbstractLayerPtr > &  selectedLayers)
signal
void te::qt::widgets::LayerTreeView::visibilityChanged ( const te::map::AbstractLayerPtr layer)
signal

Member Data Documentation

Impl* te::qt::widgets::LayerTreeView::m_pImpl
private

The tree view implementation.

Definition at line 187 of file LayerTreeView.h.

Referenced by LayerTreeView().


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