SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
qtWorkletModel Class Reference

A QAbstractListModel populated with SMTK worklets. More...

#include <qtWorkletModel.h>

Inheritance diagram for qtWorkletModel:
[legend]
Collaboration diagram for qtWorkletModel:
[legend]

Public Types

enum  Column { Column::Label, Column::WorkletOp, Column::Description, Column::Count }
 The columns of the model. More...
 

Public Member Functions

 qtWorkletModel (const smtk::view::Information &info, QObject *parent=nullptr)
 
int rowCount (const QModelIndex &parent) const override
 
int columnCount (const QModelIndex &parent) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QStringList mimeTypes () const override
 
QMimeData * mimeData (const QModelIndexList &indexes) const override
 
QModelIndex findByName (smtk::string::Token workletName) const
 Return the index of the row with the given operation type-index.
 
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...
 

Static Public Member Functions

static Column columnEnumFromName (const std::string &colName)
 Convert to/from a Column enumerant.
 
static std::string columnNameFromEnum (Column enumerant)
 

Protected Member Functions

void workletUpdate (const smtk::operation::Operation &operation, smtk::operation::Operation::Result result)
 Invoked when a worklet is added or removed.
 
void rebulidModel ()
 

Protected Attributes

std::vector< std::shared_ptr< smtk::task::Worklet > > m_worklets
 
std::vector< std::shared_ptr< smtk::task::Worklet > > m_appropriateWorklets
 
std::shared_ptr< smtk::operation::Managerm_operationManager
 
std::shared_ptr< smtk::view::Managerm_viewManager
 
smtk::operation::Observers::Key m_operationObserverKey
 
std::string m_secondaryColor { "#ffffff" }
 
smtk::extension::qtOperationLauncherm_launcher { nullptr }
 
smtk::task::TaskPtr m_parentTask
 
smtk::common::Categories::Expression m_topLevelExpression
 

Detailed Description

A QAbstractListModel populated with SMTK worklets.

The columns of the model are fixed by the Column enumeration. Worklets are ordered by their name. By using a QSortFilterProxyModel, you can subset and sort worklets using a variety of techniques.

The class constructor accepts configuration via an smtk::view::Information instance; it expects to find a configuration component named "Model" in info.configuration()->details().

Member Enumeration Documentation

◆ Column

The columns of the model.

Enumerator
Label 

The operation's label (either from its XML or an override).

WorkletOp 

The type index that uniquely identifies the operation.

Description 

The column to display a worklet's description.

Count 

Not a valid value; when cast to an integer it is the number of columns.

Member Function Documentation

◆ setParentTask()

void qtWorkletModel::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


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