SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
An SMTK view that lists types of operations. More...
#include <qtOperationPalette.h>
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 () |
virtual void | toggleFiltering (int filterState) |
![]() | |
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. | |
qtOperationTypeModel * | operationModel () const |
Return the model holding all of the operations. More... | |
qtOperationTypeView * | operationView () const |
Return the view widget holding operation buttons. | |
QLineEdit * | searchTextWidget () const |
Return the search-bar widget (if configured) or null (otherwise). | |
![]() | |
smtkTypenameMacro (qtBaseView) | |
qtBaseView (const smtk::view::Information &info) | |
const smtk::view::ConfigurationPtr & | configuration () const |
QWidget * | widget () const |
QWidget * | parentWidget () const |
qtUIManager * | uiManager () const |
const smtk::view::Information & | information () 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. | |
![]() | |
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 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. | |
![]() | |
virtual void | makeTopLevel () |
Adds properties associated with respects to a top level view. | |
Protected Attributes | |
QPointer< qtOperationTypeModel > | m_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< qtOperationTypeView > | m_list |
The list-view of operations. | |
std::shared_ptr< smtk::view::OperationDecorator > | m_decorator |
The default operation decorator owned by m_model. More... | |
![]() | |
QWidget * | Widget |
bool | m_isTopLevel |
bool | m_useSelectionManager |
smtk::view::Information | m_viewInfo |
QPointer< qtViewInfoDialog > | m_infoDialog |
bool | m_advOverlayVisible |
Friends | |
class | qtUIManager |
Additional Inherited Members | |
![]() | |
void | aboutToDestroy () |
void | modified () |
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.
If the "AlwaysLimit" configuration option is false (or absent), then a checkbox labeled "All" will be shown. The checkbox allows users to display all of the operations without any decorations.
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" AlwaysLimit="false" SubsetSort="Associability" SubsetAssociability="[4-9]"
<Model ... see qtOperationModel for configuration details ... /> </View>
|
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.
|
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.
qtOperationTypeModel * qtOperationPalette::operationModel | ( | ) | const |
Return the model holding all of the operations.
It is this model which emits "runOperation" and "editOperationParameters" signals.
|
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..)
|
protected |
The default operation decorator owned by m_model.
Toggling the "All" checkbox to unlimit operations unsets or restores the decorator on m_model.