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

An SMTK view that lists types of operations. More...

#include <qtOperationPalette.h>

Inheritance diagram for smtk::extension::qtOperationPalette:
[legend]
Collaboration diagram for smtk::extension::qtOperationPalette:
[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 editTopOperation ()
 
- 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 (qtOperationPalette)
 
 smtkSuperclassMacro (qtBaseView)
 
 qtOperationPalette (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.
 
qtOperationTypeModeloperationModel () const
 Return the model holding all of the operations. More...
 
qtOperationTypeViewoperationView () const
 Return the view widget holding operation buttons.
 
QLineEdit * searchTextWidget () const
 Return the search-bar widget (if configured) or null (otherwise).
 
- 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
 
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< qtOperationTypeModelm_model
 A QAbstractListModel that lists all registered operations.
 
QPointer< QSortFilterProxyModel > m_subset
 A proxy model that chooses a subset of operations relevant to users.
 
QPointer< QSortFilterProxyModel > m_filter
 A proxy model for users to search by operation name.
 
QPointer< QVBoxLayout > m_layout
 The central widget's layout.
 
QPointer< QLineEdit > m_search
 An optional search bar for users.
 
QPointer< qtOperationTypeViewm_list
 The list-view of operations.
 
- 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
 

Additional Inherited Members

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

Detailed Description

An SMTK view that lists types of operations.

This view configures a qtOperationTypeModel as the source of operation types to be presented. It also passes the model through two QSortFilterProxyModel instances: one which subsets operations using an OperationDecorator provided by the application and one which filters operations to match a search expression provided by the user in the optional search bar (configured with the "SearchBar" attribute). Both of these proxy models can be configured to perform a stable-sort of their output operations. Use the "SubsetSort" and "FilterSort" attributes to specify columns of the qtOperationTypeModel on which to sort. The default SubsetSort is "TypeName" while the default FilterSort is "Associability," so that operations appear first by their relevance to the current selection and then, within groups of the same relevance, sorted by the label text.

Each operation has a corresponding qtOperationAction that creates QPushButton instances for display in a dynamic grid. The push buttons cause the action to emit either an "acceptDefaults" or "editParameters" signal, depending on the whether the operation can be configured to run with defaults and whether the user has clicked or double-clicked on the button. A search bar may also be configured.

The view configuration of the operation palette may include a model configuration to direct how the qtOperationTypeModel is configured and may also include an "OperationDecorator" configuration that provides overrides for the presentation style of operations. Note that if an smtk::common::Managers::Ptr is included in the constructor's smtk::view::Information and it contains a QSharedPointer<qtOperationTypeModel>, that object will be used instead of constructing a model solely for the view. This allows applications to provide a single model for many purposes (toolbox, toolbars, menu actions, etc.).

<View Type="qtOperationPalette" SearchBar="true" FilterSort="Precendence" SubsetSort="Associability" SubsetAssociability="[4-9]"

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

Member Function Documentation

◆ createWidget()

void qtOperationPalette::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 qtOperationPalette::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.

◆ operationModel()

qtOperationTypeModel * qtOperationPalette::operationModel ( ) const

Return the model holding all of the operations.

It is this model which emits "runOperation" and "editOperationParameters" signals.

◆ updateUI

void smtk::extension::qtOperationPalette::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: