SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
smtk::extension::qtAttributeItemInfo Class Reference

Class used to generate widgets for Attribute Items. More...

#include <qtAttributeItemInfo.h>

Collaboration diagram for smtk::extension::qtAttributeItemInfo:
[legend]

Public Member Functions

 qtAttributeItemInfo (smtk::attribute::ItemPtr item, smtk::view::Configuration::Component itemComp, QPointer< QWidget > parent, qtBaseView *bview)
 
qtBaseAttributeViewbaseView () const
 Method to return the qtBaseView that requested the creation of the qtItem.
 
qtUIManageruiManager () const
 Method to return the qtUIManager that is being used to generate the UI. More...
 
std::map< std::string, smtk::view::Configuration::Component > & childrenViewInfo () const
 Method to return the style information for the item's children. More...
 
bool createNewDictionary (std::map< std::string, qtAttributeItemInfo > &dict)
 A method that can construct a dictionary from the qtAttributeItemInfo's children view information as well as from its configuration component. More...
 
void setItem (const smtk::attribute::ItemPtr &item)
 Methods to set and retrieve the item to be used by the generated qtItem.
 
smtk::attribute::ItemPtr item () const
 Methods to set and retrieve the item to be used by the generated qtItem.
 
template<typename ItemType >
std::shared_ptr< ItemType > itemAs () const
 Methods to set and retrieve the item to be used by the generated qtItem.
 
void setComponent (const smtk::view::Configuration::Component &comp)
 Methods to set and retrieve the Component Style Information to be used to generate a qtItem.
 
smtk::view::Configuration::Component component () const
 Methods to set and retrieve the Component Style Information to be used to generate a qtItem.
 
void setParentWidget (QPointer< QWidget > widget)
 Methods to set and retrieve the widget to be used as the parent for the generated qtItem.
 
QPointer< QWidget > parentWidget () const
 Methods to set and retrieve the widget to be used as the parent for the generated qtItem.
 

Static Public Member Functions

static bool buildFromComponent (smtk::view::Configuration::Component comp, qtBaseAttributeView *view, std::map< std::string, qtAttributeItemInfo > &dict)
 A helper method that can construct a dictionary from a View Component representing a block of Item Styles. More...
 

Protected Attributes

smtk::attribute::WeakItemPtr m_item
 Pointer to the attribute Item.
 
smtk::view::Configuration::Component m_component
 qtItem Component Definition
 
QPointer< QWidget > m_parentWidget
 Parent Widget of the qtItem.
 
QPointer< qtBaseAttributeViewm_baseView
 View Definition.
 
std::map< std::string, smtk::view::Configuration::Componentm_childrenViewInfo
 Dictionary of component information for child of the item.
 

Detailed Description

Class used to generate widgets for Attribute Items.

This class is used by the qtUIManager to construct qtItem instances using registered factory methods. This information includes the following:

Member Function Documentation

◆ buildFromComponent()

bool qtAttributeItemInfo::buildFromComponent ( smtk::view::Configuration::Component  comp,
qtBaseAttributeView view,
std::map< std::string, qtAttributeItemInfo > &  dict 
)
static

A helper method that can construct a dictionary from a View Component representing a block of Item Styles.

Each child Component of comp represents an item either using an Item attribute (Old Style) or a Path attribute (New Style). For each child Component, the root item is extracted. If the root item is not in the dictionary then a new qtAttributeItemInfo is inserted using the root item name as the key and sets its baseView. If the remainder of the path is empty the child Component is assigned to the corresponding qtAttributeItemInfo, else the new path and the child Component are inserted into the qtAttributeItemInfo's children view information.

◆ childrenViewInfo()

std::map<std::string, smtk::view::Configuration::Component>& smtk::extension::qtAttributeItemInfo::childrenViewInfo ( ) const

Method to return the style information for the item's children.

The key string represents a path to an item's child and the corresponding Component represents the style infomation that is to be used to generate its qtItem

◆ createNewDictionary()

bool qtAttributeItemInfo::createNewDictionary ( std::map< std::string, qtAttributeItemInfo > &  dict)

A method that can construct a dictionary from the qtAttributeItemInfo's children view information as well as from its configuration component.

For each entry in m_childenViewInfo, the root item is extracted from the key. If the root item is not in the new dictionary then a new qtAttributeItemInfo is inserted using the root item name as the key and sets its baseView. If the remainder of the path is empty the associated Component is assigned to the corresponding qtAttributeItemInfo, else the new path and the Component are inserted into the qtAttributeItemInfo's children view information.

If the instance's m_component contains an "ItemView" section, the section's contents are then added to the dictionary. This allows an Item's configuration to override configurations inherited from it's parent.

◆ uiManager()

qtUIManager * qtAttributeItemInfo::uiManager ( ) const

Method to return the qtUIManager that is being used to generate the UI.

Note that the manager is retrived via the qtBaseView assigned. If the view does not have a manager or if the view is not set then this method will return nullptr.


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