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

A tree-view UI for attribute associations and reference-items. More...

#include <qtReferenceTree.h>

Inheritance diagram for smtk::extension::qtReferenceTree:
[legend]
Collaboration diagram for smtk::extension::qtReferenceTree:
[legend]

Public Slots

void updateItemData () override
 
virtual void synchronizeMembers ()
 
- Public Slots inherited from smtk::extension::qtItem
virtual void updateItemData ()
 Tell the qtItem to update itself based on changes to its underlying attribute item.
 

Public Member Functions

 qtReferenceTree (const qtAttributeItemInfo &info)
 
void markForDeletion () override
 Indicates that the item should be deleted. More...
 
qt::MembershipCriteria membershipCriteria () const
 
std::string membershipFilter () const
 
void setLabelVisible (bool) override
 
bool setSelectionIconPaths (const std::string &selectedIconPath, const std::string &unselectedIconPath)
 Set the paths (into qrc files or the local filesystem) of icons used to indicate which items are selected and which are not. More...
 
std::pair< std::string, std::string > selectionIconPaths () const
 Return the paths to icons used to display the membership in the item.
 
std::shared_ptr< smtk::view::PhraseModelphraseModel () const
 Return the phrase model controlling the tree's contents.
 
- Public Member Functions inherited from smtk::extension::qtItem
 qtItem (const qtAttributeItemInfo &info)
 
smtk::attribute::ItemPtr item () const
 
template<typename ItemType >
std::shared_ptr< ItemType > itemAs () const
 
qtUIManageruiManager () const
 
smtk::attribute::ResourcePtr attributeResource () const
 Return the underlying Attribute Resource.
 
QPointer< QWidget > widget ()
 
QPointer< QWidget > parentWidget ()
 
bool isLeafItem ()
 
virtual bool isFixedWidth () const
 
void showAdvanceLevelOverlay (bool)
 
bool useSelectionManager () const
 
void setReadOnly (bool mode)
 
bool isReadOnly () const
 

Static Public Member Functions

static qtItemcreateItemWidget (const qtAttributeItemInfo &info)
 

Protected Types

enum  UpdateSource { UpdateSource::ITEM_FROM_GUI, UpdateSource::GUI_FROM_ITEM }
 Indicate whether the GUI should be updated from the item it presents or vice versa. More...
 

Protected Slots

void removeObservers ()
 
virtual void setOutputOptional (int state)
 
virtual void linkHover (bool link)
 Link this item to the "hovered" selection bit. More...
 
virtual void linkHoverTrue ()
 
virtual void linkHoverFalse ()
 
virtual void copyFromSelection ()
 
virtual void copyToSelection ()
 
virtual void clearItem ()
 
void membershipChanged (int val)
 Update our labels when the membership badge has changed.
 
- Protected Slots inherited from smtk::extension::qtItem
virtual void onAdvanceLevelChanged (int levelIdx)
 
virtual void onChildWidgetSizeChanged ()
 

Protected Member Functions

virtual smtk::view::PhraseModelPtr createPhraseModel () const
 Subclasses override this to create a model of the appropriate type. More...
 
void createWidget () override
 
virtual void clearWidgets ()
 
virtual void updateUI ()
 
bool eventFilter (QObject *src, QEvent *event) override
 
virtual void toggleCurrentItem (bool membership)
 Toggle the currently-selected item(s)'s membership (when membership is true) or visibility (when membership is false). More...
 
virtual bool synchronize (UpdateSource src)
 Children must implement this.
 
smtk::extension::qt::MembershipBadge::MemberMap & members () const
 retrieve membership from the phraseModel's badge
 
void checkRemovedComponents (smtk::view::DescriptivePhrasePtr, smtk::view::PhraseModelEvent, const std::vector< int > &, const std::vector< int > &, const std::vector< int > &)
 
- Protected Member Functions inherited from smtk::extension::qtItem
virtual void setLocalAdvanceLevel (unsigned int level)
 
virtual void addChildItem (qtItem *)
 
virtual void removeChildItem (qtItem *)
 
virtual void clearChildItems ()
 
QList< qtItem * > & childItems ()
 

Protected Attributes

qtReferenceTreeDatam_p
 
- Protected Attributes inherited from smtk::extension::qtItem
QPointer< QWidget > m_widget
 
bool m_isLeafItem
 
bool m_useSelectionManager
 
bool m_readOnly
 
bool m_markedForDeletion
 
qtAttributeItemInfo m_itemInfo
 
QList< smtk::extension::qtItem * > m_childItems
 

Additional Inherited Members

- Signals inherited from smtk::extension::qtItem
void widgetSizeChanged ()
 Signal indicates that the underlying widget's size has been modified.
 
void modified ()
 Signal indicates that the underlying item has been modified.
 
void childModified (qtItem *item)
 Signal indicates that the child from the underlying item has been modified More...
 

Detailed Description

A tree-view UI for attribute associations and reference-items.

The qtReferenceTree class provides a uniform GUI for selecting entries that populate an attribute's item while abstracting away the types of those entries. The organization of the tree can be configured on a per-instance basis by choosing different phrase models and subphrase generators. A subset of the tree identified by a MembershipCriteria and a filter string is made available for selection (and thus inclusion in the associated or referenced components/resources/objects).

Member Enumeration Documentation

◆ UpdateSource

Indicate whether the GUI should be updated from the item it presents or vice versa.

Enumerator
ITEM_FROM_GUI 

Update the attribute-system's reference-item to match the GUI.

GUI_FROM_ITEM 

Update the GUI to match the attribute-system's reference-item.

Member Function Documentation

◆ createPhraseModel()

smtk::view::PhraseModelPtr qtReferenceTree::createPhraseModel ( ) const
protectedvirtual

Subclasses override this to create a model of the appropriate type.

The model should be configured using information the item (this->configuration()) and be ready for use.

◆ linkHover

void qtReferenceTree::linkHover ( bool  link)
protectedvirtualslot

Link this item to the "hovered" selection bit.

This should set up the initial state, observe changes to the item, and update the selection, and add some indication to the item showing the "hovered" status (e.g., a color swatch).

◆ markForDeletion()

void qtReferenceTree::markForDeletion ( )
overridevirtual

Indicates that the item should be deleted.

This is similar to Qt's deleteLater() method (in fact it calls it); however, it also allows the qtItem to do some cleanup such as stop observing SMTK "signals".

Reimplemented from smtk::extension::qtItem.

◆ setSelectionIconPaths()

bool qtReferenceTree::setSelectionIconPaths ( const std::string &  selectedIconPath,
const std::string &  unselectedIconPath 
)

Set the paths (into qrc files or the local filesystem) of icons used to indicate which items are selected and which are not.

This returns true if the values were modified and false otherwise.

Note that calling this method will not result in re-renders of any views displaying the model; you are responsible for calling this method before rendering takes place or for causing a render if calling after the initial render.

◆ toggleCurrentItem()

void qtReferenceTree::toggleCurrentItem ( bool  membership)
protectedvirtual

Toggle the currently-selected item(s)'s membership (when membership is true) or visibility (when membership is false).

Called by eventFilter() when user hits space (membership) or enter (visibility).


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