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

An SMTK view that lists worklets which can be added to a project's workflow. More...

#include <qtWorkletPalette.h>

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

Public Slots

void updateUI () override
 Have the view update its contents. More...
 
void childrenResized () override
 
void showAdvanceLevel (int) override
 Have the view update its contents based on a new advance level.
 
void enableShowBy (int) override
 
void onInfo () override
 Display view information (i.e., help text)
 
void onShowCategory () override
 
virtual void instantiateTopWorklet ()
 
virtual void toggleFiltering (int filterState)
 
- 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 ()
 

Signals

void emplaceWorklet (const std::string &workletName, const std::array< double, 2 > &location)
 
- Signals inherited from smtk::extension::qtBaseView
void aboutToDestroy ()
 
void modified ()
 

Public Member Functions

 smtkTypenameMacro (qtWorkletPalette)
 
 smtkSuperclassMacro (qtBaseView)
 
 qtWorkletPalette (const smtk::view::Information &info)
 
bool isEmpty () const override
 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...
 
QSortFilterProxyModel * model () const
 Return the model displayed in the view.
 
qtWorkletModelworkletModel () const
 Return the model holding all of the worklets.
 
QTableView * workletView () const
 Return the view widget holding worklet buttons.
 
QLineEdit * searchTextWidget () const
 Return the search-bar widget (if configured) or null (otherwise).
 
void setToplevelCatagoryExpression (const smtk::common::Categories::Expression &exp)
 Set the category expression to be used to determine worklets that can be placed at the top-level of a workflow.
 
void setParentTask (const smtk::task::TaskPtr &task)
 Set the task to be the potential parent of em-placed worklets. More...
 
- 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 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 bool validateInformation (const smtk::view::Information &info)
 
- Static Public Member Functions inherited from smtk::extension::qtBaseView
static bool validateInformation (const smtk::view::Information &info)
 

Protected Member Functions

void buildUI () override
 Creates the UI related to the view and properly assigns it to the parent widget.
 
void createWidget () override
 Creates the main QT Widget that is associated with a View. More...
 
void setInfoToBeDisplayed () override
 Set the information to be displayed in the ViewInfoDialog.
 
- Protected Member Functions inherited from smtk::extension::qtBaseView
virtual void makeTopLevel ()
 Adds properties associated with respects to a top level view.
 

Protected Attributes

QPointer< qtWorkletModelm_model
 A QAbstractListModel that lists all registered worklets.
 
QPointer< QSortFilterProxyModel > m_filter
 A proxy model for users to search by worklet name.
 
QPointer< QVBoxLayout > m_layout
 The central widget's layout.
 
QPointer< QLineEdit > m_search
 An optional search bar for users.
 
QPointer< QTableView > m_list
 The list-view of worklets.
 
- 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
 

Friends

class qtUIManager
 

Detailed Description

An SMTK view that lists worklets which can be added to a project's workflow.

This view configures a qtWorkletModel as the source of worklets to be presented. It also passes the model through a QSortFilterProxyModel which filters (and sorts worklets to match a search expression provided by the user in the optional search bar (configured with the "SearchBar" attribute). This proxy model can be configured to perform a stable-sort of its output worklets. Use the "FilterSort" attributes to specify columns of the qtWorkletModel on which to sort. The default FilterSort is "Label," so that worklets appear sorted by their name.

The view configuration of the worklet palette may include a model configuration to direct how the qtWorkletModel is configured.

<View Type="qtWorkletPalette" SearchBar="true" FilterSort="Label"

<Model ... see qtWorkletModel for configuration details ... /> </View>

Member Function Documentation

◆ createWidget()

void qtWorkletPalette::createWidget ( )
overrideprotectedvirtual

Creates the main QT Widget that is associated with a View.

Typically this is the only method a derived View needs to override.

Reimplemented from smtk::extension::qtBaseView.

◆ isEmpty()

bool qtWorkletPalette::isEmpty ( ) const
overridevirtual

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.

This method will check to see if this is the case and call the onShowCategory method Return true if the view does not contain any information to display. Subclasses should override this method and return false by default unless they have specific knowledge that the view is vacuous.

Reimplemented from smtk::extension::qtBaseView.

◆ setParentTask()

void qtWorkletPalette::setParentTask ( const smtk::task::TaskPtr task)

Set the task to be the potential parent of em-placed worklets.

Note that task can be null indicating that the worklet would be em-placed at the workflow's top-level

◆ updateUI

void smtk::extension::qtWorkletPalette::updateUI ( )
inlineoverrideslot

Have the view update its contents.

The public method slot is used to update the view's GUI based on its contents and the state of it's UIManager (category and advance level state, etc..)


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