Skip to content

Class CogoOperationsModel

ClassList > CogoOperationsModel

A model holding the list of COGO operations available in the COGO registry.

  • #include <cogooperationsmodel.h>

Inherits the following classes: QAbstractListModel

Public Types

Type Name
enum OperationRoles

Public Functions

Type Name
CogoOperationsModel (QObject * parent=nullptr)
void buildModel ()
QVariant data (const QModelIndex & index, int role=Qt::DisplayRole) override const
Q_INVOKABLE QVariantMap get (int row) const
Q_INVOKABLE QVariantMap get (const QString & name) const
QHash< int, QByteArray > roleNames () override const
int rowCount (const QModelIndex & parent=QModelIndex()) override const

Public Types Documentation

enum OperationRoles

enum CogoOperationsModel::OperationRoles {
    NameRole = Qt::UserRole + 1,
    DisplayNameRole,
    IconRole
};

Public Functions Documentation

function CogoOperationsModel

explicit CogoOperationsModel::CogoOperationsModel (
    QObject * parent=nullptr
) 

The COGO operations model constructor.


function buildModel

void CogoOperationsModel::buildModel () 

Builds the model against the COGO operations available in the COGO registry.


function data

QVariant CogoOperationsModel::data (
    const QModelIndex & index,
    int role=Qt::DisplayRole
) override const

function get [1/2]

Q_INVOKABLE QVariantMap CogoOperationsModel::get (
    int row
) const

Returns a COGO operation data map for a given row.


function get [2/2]

Q_INVOKABLE QVariantMap CogoOperationsModel::get (
    const QString & name
) const

Returns a COGO operation data map matching the given name.


function roleNames

QHash< int, QByteArray > CogoOperationsModel::roleNames () override const

function rowCount

int CogoOperationsModel::rowCount (
    const QModelIndex & parent=QModelIndex()
) override const


The documentation for this class was generated from the following file src/core/cogo/cogooperationsmodel.h