SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A QAbstractListModel populated with SMTK worklets. More...
#include <qtWorkletModel.h>
Classes | |
struct | Item |
A row in the model's table. More... | |
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. | |
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. | |
Protected Attributes | |
std::vector< Item > | m_worklets |
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 } |
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.