SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A QAbstractListModel populated with SMTK worklets. More...
#include <qtWorkletModel.h>
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::Manager > | m_operationManager |
std::shared_ptr< smtk::view::Manager > | m_viewManager |
smtk::operation::Observers::Key | m_operationObserverKey |
std::string | m_secondaryColor { "#ffffff" } |
smtk::extension::qtOperationLauncher * | m_launcher { nullptr } |
smtk::task::TaskPtr | m_parentTask |
smtk::common::Categories::Expression | m_topLevelExpression |
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()
.
|
strong |
The columns of the model.
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