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

A panel that displays SMTK resources available to the application/user. More...

#include <qtResourceBrowser.h>

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

Public Slots

virtual void sendPanelSelectionToSMTK (const QItemSelection &selected, const QItemSelection &deselected)
 
virtual void sendSMTKSelectionToPanel (const std::string &src, smtk::view::SelectionPtr seln)
 
virtual void addSource (smtk::common::TypeContainer &managers)
 
virtual void removeSource (smtk::common::TypeContainer &managers)
 
- Public Slots inherited from smtk::extension::qtBaseView
virtual void updateUI ()
 Have the view update its contents. More...
 
virtual void childrenResized ()
 
virtual void showAdvanceLevelOverlay (bool val)
 
virtual void showAdvanceLevel (int)
 Have the view update its contents based on a new advance level.
 
virtual void enableShowBy (int)
 
virtual void onInfo ()
 Display view information (i.e., help text)
 
virtual void onShowCategory ()
 

Public Member Functions

 smtkTypenameMacro (qtResourceBrowser)
 
 qtResourceBrowser (const smtk::view::Information &info)
 
QTreeView * view () const
 
smtk::view::PhraseModelPtr phraseModel () const
 
void setPhraseModel (const smtk::view::PhraseModelPtr &)
 
smtk::view::SubphraseGeneratorPtr phraseGenerator () const
 
void setPhraseGenerator (smtk::view::SubphraseGeneratorPtr spg)
 
smtk::extension::qtDescriptivePhraseModeldescriptivePhraseModel () const
 
void setDescriptivePhraseModel (QAbstractItemModel *qmodel)
 
bool highlightOnHover () const
 
void setHighlightOnHover (bool highlight)
 
 Internal ()
 
void setup (qtResourceBrowser *self, const smtk::view::PhraseModelPtr &phraseModel, const std::string &viewName, QAbstractItemModel *qmodel, QWidget *parent, const std::shared_ptr< smtk::view::Selection > &selection=std::shared_ptr< smtk::view::Selection >(), bool searchBar=false)
 
smtk::extension::qtDescriptivePhraseModeldescriptivePhraseModel () const
 
void setDescriptivePhraseModel (QAbstractItemModel *qmodel)
 
- Public Member Functions inherited from smtk::extension::qtBaseView
 smtkTypenameMacro (qtBaseView)
 
 qtBaseView (const smtk::view::Information &info)
 
const smtk::view::ConfigurationPtrconfiguration () const
 
QWidget * widget () const
 
QWidget * parentWidget () const
 
qtUIManageruiManager () const
 
const smtk::view::Informationinformation () const
 Return the view's specification (its configuration plus environment information).
 
virtual int advanceLevel () const
 
virtual bool categoryEnabled () const
 
virtual std::string currentCategory () const
 
virtual void setInitialCategory ()
 When category filtering is requested to be either on by default or is requested to be on permanently, we need to have a mechanism to force the views to display info based on the initial category. More...
 
bool isTopLevel () const
 
virtual bool isEmpty () const
 Return true if the view does not contain any information to display. More...
 
virtual bool isValid () const
 Return true if the view's contents are valid.
 
- Public Member Functions inherited from smtk::view::BaseView
 smtkTypenameMacroBase (BaseView)
 
virtual std::size_t index () const
 index is a compile-time intrinsic of the derived view; as such, it cannot be set.
 

Static Public Member Functions

static qtBaseViewcreateViewWidget (const smtk::view::Information &info)
 
static QTreeView * createDefaultView (QWidget *parent)
 
static const std::string & getJSONConfiguration ()
 Return the string that represents the configuration for browser components.
 
- Static Public Member Functions inherited from smtk::extension::qtBaseView
static bool validateInformation (const smtk::view::Information &info)
 

Public Attributes

QWidget * m_container { nullptr }
 
QVBoxLayout * m_layout { nullptr }
 
QTreeView * m_view { nullptr }
 
QPointer< qtResourceBrowserm_self
 
QPointer< QAbstractItemModel > m_model
 
QPointer< smtk::extension::qtDescriptivePhraseDelegatem_delegate
 
std::map< smtk::resource::ManagerPtr, int > m_observers
 
smtk::view::PhraseModelPtr m_phraseModel
 
smtk::view::SelectionPtr m_seln
 
smtk::view::SelectionObservers::Key m_selnHandle
 
int m_selnValue
 
int m_hoverValue
 
std::string m_selnSource
 
std::string m_selnLabel
 
std::string m_hoverLabel
 
std::string m_viewName
 
std::string m_resourceTreeType
 
int m_resourceTreeStyle { -1 }
 
QPointer< QSortFilterProxyModel > m_filter
 A proxy model for users to search by name.
 
QPointer< QLineEdit > m_search
 An optional search bar for users.
 
bool m_updatingPanelSelectionFromSMTK { false }
 

Protected Slots

virtual void hoverRow (const QModelIndex &idx)
 
virtual void resetHover ()
 

Protected Member Functions

virtual void resetHover (smtk::resource::ComponentSet &add, smtk::resource::ComponentSet &del)
 Called when the user asks to change the color. More...
 
bool eventFilter (QObject *, QEvent *) override
 
- Protected Member Functions inherited from smtk::extension::qtBaseView
virtual void buildUI ()
 Creates the UI related to the view and properly assigns it to the parent widget.
 
virtual void createWidget ()
 Creates the main QT Widget that is associated with a View. More...
 
virtual void makeTopLevel ()
 Adds properties associated with respects to a top level view.
 
virtual void setInfoToBeDisplayed ()
 Set the information to be displayed in the ViewInfoDialog.
 

Protected Attributes

Internal * m_p
 
- Protected Attributes inherited from smtk::extension::qtBaseView
QWidget * Widget
 
bool m_isTopLevel
 
bool m_useSelectionManager
 
smtk::view::Information m_viewInfo
 
QPointer< qtViewInfoDialogm_infoDialog
 
bool m_advOverlayVisible
 

Static Protected Attributes

static std::string s_configurationJSON = ResourcePanelConfiguration_json
 

Additional Inherited Members

- Signals inherited from smtk::extension::qtBaseView
void aboutToDestroy ()
 
void modified ()
 

Detailed Description

A panel that displays SMTK resources available to the application/user.

A "private" object for use only by qtResourceBrowser and its subclasses.

This contains Qt widget that displays a tree or list view holding an SMTK descriptive phrase model.

Its Information should be initialized with json/xml that contains: (1) an smtk::view::PhraseModel that you have configured, (2) the string name registered to a QAbstractItemView subclass constructor, (3) a QAbstactItemModel implementing qtDescriptivePhraseModel model index queries, and (4) a parent QWidget.

This QAbstractItemModel class should either be a qtDescriptivePhraseModel or QAbstractProxyModel whose source is a qtDescriptivePhraseModel. Because of that, indices from the QAbstractItemModel will provide properties that can be used by a qtDescriptivePhraseDelegate instance, which this class creates and owns to control how the tree rows are rendered.

Member Function Documentation

◆ resetHover()

void qtResourceBrowser::resetHover ( smtk::resource::ComponentSet add,
smtk::resource::ComponentSet del 
)
protectedvirtual

Called when the user asks to change the color.

This pops up a color editor dialog, which we can make ParaView-specific if needed and which can be a "singleton" (i.e., re-use the same dialog so that users do not accidentally pop up one per descriptive phrase and get confused).


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