OpenWalnut  1.5.0dev
Public Slots | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
WQtTreeItem Class Reference

Base class for all items in the control panel tree. More...

#include <WQtTreeItem.h>

+ Inheritance diagram for WQtTreeItem:
+ Collaboration diagram for WQtTreeItem:

Public Slots

void update ()
 Gets called by m_updateTimer in some interval to update the item state, basing on the state of m_module. More...
 

Public Member Functions

 WQtTreeItem (QTreeWidgetItem *parent, WTreeItemType type, std::shared_ptr< WModule > module)
 Constructor creates an empty item. More...
 
virtual ~WQtTreeItem ()
 Destructor. More...
 
WModule::SPtr getModule ()
 Get for the module pointer. More...
 
std::string getName ()
 Returns the name used for this tree item. More...
 
virtual void gotRemoved ()
 Gets called by the GUI whenever the module was removed from the root container and should now be deleted. More...
 
std::string getHandledInput () const
 The name of the input represented by this item. More...
 
void setHandledInput (std::string in)
 Sets the name of the input represented by this item. More...
 
std::string getHandledOutput () const
 The name of the output represented by this item. More...
 
void setHandledOutput (std::string out)
 Sets the name of the output represented by this item. More...
 
virtual void handleCheckStateChange ()
 Handle changes in check state. More...
 

Static Public Member Functions

static std::string createTooltip (WModule::SPtr module)
 Create tooltip for a given module. More...
 

Protected Member Functions

virtual void updateState ()
 Updates the state of the tree item basing on the module's state. More...
 

Protected Attributes

std::shared_ptr< QTimer > m_updateTimer
 Updates this item in regular intervals. More...
 
std::string m_name
 Name of the tree item. More...
 
bool m_deleteInProgress
 True if the treeitem and the module gets deleted currently. More...
 
bool m_needPostDeleteEvent
 True if no delete event has been posted yet. More...
 
WPropString m_nameProp
 The property containing the name of the module. More...
 
std::string m_handledInput
 The name of the input connector represented by this item. More...
 
std::string m_handledOutput
 The output name handled by this item. More...
 

Private Member Functions

void nameChanged ()
 Called when the name property changes. More...
 
void slotDataChanged (std::shared_ptr< WModuleConnector > connector)
 Called on output-connector update. More...
 

Private Attributes

std::shared_ptr< WModulem_module
 The module represented by this tree item. More...
 
std::vector< boost::signals2::connection > m_outputUpdateConnections
 The output connector update connections. More...
 

Detailed Description

Base class for all items in the control panel tree.

Definition at line 43 of file WQtTreeItem.h.

Constructor & Destructor Documentation

◆ WQtTreeItem()

WQtTreeItem::WQtTreeItem ( QTreeWidgetItem parent,
WTreeItemType  type,
std::shared_ptr< WModule module 
)

Constructor creates an empty item.

Parameters
parentThe widget managing this widget
moduleThe represented module
typethe type used for the treeitem. Used to identify the items.

Definition at line 48 of file WQtTreeItem.cpp.

References m_module, m_name, m_nameProp, m_outputUpdateConnections, m_updateTimer, nameChanged(), slotDataChanged(), and update().

+ Here is the call graph for this function:

◆ ~WQtTreeItem()

WQtTreeItem::~WQtTreeItem ( )
virtual

Destructor.

Definition at line 99 of file WQtTreeItem.cpp.

References m_outputUpdateConnections.

Member Function Documentation

◆ createTooltip()

std::string WQtTreeItem::createTooltip ( WModule::SPtr  module)
static

Create tooltip for a given module.

This can be used by all the widgets needing a tooltip for a module.

Parameters
modulethe module to create the tooltip for
Returns
the tooltip.

Definition at line 119 of file WQtTreeItem.cpp.

Referenced by WQtNetworkItem::updater(), and updateState().

+ Here is the caller graph for this function:

◆ getHandledInput()

std::string WQtTreeItem::getHandledInput ( ) const

The name of the input represented by this item.

Returns
handled input

Definition at line 280 of file WQtTreeItem.cpp.

References m_handledInput.

◆ getHandledOutput()

std::string WQtTreeItem::getHandledOutput ( ) const

The name of the output represented by this item.

Returns
handled output

Definition at line 290 of file WQtTreeItem.cpp.

References m_handledOutput.

◆ getModule()

std::shared_ptr< WModule > WQtTreeItem::getModule ( )

Get for the module pointer.

Returns
the pointer to the module associated with this item.

Definition at line 109 of file WQtTreeItem.cpp.

References m_module.

Referenced by WQtControlPanel::deleteModule(), WQtControlPanel::event(), WQtNetworkEditor::event(), WQtControlPanel::findItemsByModule(), and WQtControlPanel::getSelectedModule().

+ Here is the caller graph for this function:

◆ getName()

std::string WQtTreeItem::getName ( )

Returns the name used for this tree item.

Returns
the name.

Definition at line 114 of file WQtTreeItem.cpp.

References m_name.

◆ gotRemoved()

void WQtTreeItem::gotRemoved ( )
virtual

Gets called by the GUI whenever the module was removed from the root container and should now be deleted.

Definition at line 266 of file WQtTreeItem.cpp.

References m_deleteInProgress.

◆ handleCheckStateChange()

void WQtTreeItem::handleCheckStateChange ( )
virtual

Handle changes in check state.

Definition at line 300 of file WQtTreeItem.cpp.

References m_module.

Referenced by WQtControlPanel::changeTreeItem().

+ Here is the caller graph for this function:

◆ nameChanged()

void WQtTreeItem::nameChanged ( )
private

Called when the name property changes.

Definition at line 274 of file WQtTreeItem.cpp.

References m_name, and m_nameProp.

Referenced by WQtTreeItem().

+ Here is the caller graph for this function:

◆ setHandledInput()

void WQtTreeItem::setHandledInput ( std::string  in)

Sets the name of the input represented by this item.

Parameters
inthe input name.

Definition at line 285 of file WQtTreeItem.cpp.

References m_handledInput.

◆ setHandledOutput()

void WQtTreeItem::setHandledOutput ( std::string  out)

Sets the name of the output represented by this item.

Parameters
outthe output name.

Definition at line 295 of file WQtTreeItem.cpp.

References m_handledOutput.

◆ slotDataChanged()

void WQtTreeItem::slotDataChanged ( std::shared_ptr< WModuleConnector connector)
private

Called on output-connector update.

Parameters
connectorthe connector that was updated.

Definition at line 165 of file WQtTreeItem.cpp.

References WQtGui::getMainWindow(), and m_module.

Referenced by WQtTreeItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update

void WQtTreeItem::update ( )
slot

Gets called by m_updateTimer in some interval to update the item state, basing on the state of m_module.

Definition at line 171 of file WQtTreeItem.cpp.

References updateState().

Referenced by WQtTreeItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateState()

void WQtTreeItem::updateState ( )
protectedvirtual

Updates the state of the tree item basing on the module's state.

Definition at line 176 of file WQtTreeItem.cpp.

References createTooltip(), WQtGui::getMainWindow(), m_deleteInProgress, m_handledInput, m_handledOutput, m_module, m_name, and m_needPostDeleteEvent.

Referenced by update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_deleteInProgress

bool WQtTreeItem::m_deleteInProgress
protected

True if the treeitem and the module gets deleted currently.

Definition at line 149 of file WQtTreeItem.h.

Referenced by gotRemoved(), and updateState().

◆ m_handledInput

std::string WQtTreeItem::m_handledInput
protected

The name of the input connector represented by this item.

Definition at line 164 of file WQtTreeItem.h.

Referenced by getHandledInput(), setHandledInput(), and updateState().

◆ m_handledOutput

std::string WQtTreeItem::m_handledOutput
protected

The output name handled by this item.

Definition at line 169 of file WQtTreeItem.h.

Referenced by getHandledOutput(), setHandledOutput(), and updateState().

◆ m_module

std::shared_ptr< WModule > WQtTreeItem::m_module
private

The module represented by this tree item.

Definition at line 175 of file WQtTreeItem.h.

Referenced by getModule(), handleCheckStateChange(), slotDataChanged(), updateState(), and WQtTreeItem().

◆ m_name

std::string WQtTreeItem::m_name
protected

Name of the tree item.

Definition at line 144 of file WQtTreeItem.h.

Referenced by getName(), nameChanged(), updateState(), and WQtTreeItem().

◆ m_nameProp

WPropString WQtTreeItem::m_nameProp
protected

The property containing the name of the module.

Definition at line 159 of file WQtTreeItem.h.

Referenced by nameChanged(), and WQtTreeItem().

◆ m_needPostDeleteEvent

bool WQtTreeItem::m_needPostDeleteEvent
protected

True if no delete event has been posted yet.

Definition at line 154 of file WQtTreeItem.h.

Referenced by updateState().

◆ m_outputUpdateConnections

std::vector< boost::signals2::connection > WQtTreeItem::m_outputUpdateConnections
private

The output connector update connections.

The NEED to be disconnected on destruction manually!

Definition at line 185 of file WQtTreeItem.h.

Referenced by WQtTreeItem(), and ~WQtTreeItem().

◆ m_updateTimer

std::shared_ptr< QTimer > WQtTreeItem::m_updateTimer
protected

Updates this item in regular intervals.

Definition at line 139 of file WQtTreeItem.h.

Referenced by WQtTreeItem().


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