SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Class used to generate widgets for Attribute Items. More...
#include <qtAttributeItemInfo.h>
Public Member Functions | |
qtAttributeItemInfo (smtk::attribute::ItemPtr item, smtk::view::Configuration::Component itemComp, QPointer< QWidget > parent, qtBaseView *bview) | |
qtBaseAttributeView * | baseView () const |
Method to return the qtBaseView that requested the creation of the qtItem. | |
qtUIManager * | uiManager () const |
Method to return the qtUIManager that is being used to generate the UI. More... | |
bool | toBeDisplayed () const |
Indicates that the underlying item should be displayed. 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< qtBaseAttributeView > | m_baseView |
View Definition. | |
std::map< std::string, smtk::view::Configuration::Component > | m_childrenViewInfo |
Dictionary of component information for child of the item. | |
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:
|
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.
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 information that is to be used to generate its qtItem
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.
bool qtAttributeItemInfo::toBeDisplayed | ( | ) | const |
Indicates that the underlying item should be displayed.
This will true if return all of the following are true:
qtUIManager * qtAttributeItemInfo::uiManager | ( | ) | const |
Method to return the qtUIManager that is being used to generate the UI.
Note that the manager is retrieved 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.