#include <compositionmodel.h>
Definition at line 15 of file compositionmodel.h.
◆ CompositionModel()
| CompositionModel::CompositionModel |
( |
QObject * | parent = 0 | ) |
|
◆ ~CompositionModel()
| CompositionModel::~CompositionModel |
( |
| ) |
|
|
override |
◆ columnCount()
| int CompositionModel::columnCount |
( |
const QModelIndex & | parent = QModelIndex() | ) |
const |
|
override |
◆ compositionFromIndex()
Definition at line 85 of file compositionmodel.cpp.
86{
87 if(index.isValid()) {
89 }
91}
QList< KisLayerCompositionSP > m_compositions
QSharedPointer< KisLayerComposition > KisLayerCompositionSP
References m_compositions.
◆ data()
| QVariant CompositionModel::data |
( |
const QModelIndex & | index, |
|
|
int | role = Qt::DisplayRole ) const |
|
override |
Definition at line 22 of file compositionmodel.cpp.
23{
24 if (index.isValid()) {
25
26 switch (role) {
27 case Qt::DisplayRole:
28 {
30 }
31 case Qt::DecorationRole:
32 {
34 }
35 case Qt::CheckStateRole: {
36 return m_compositions.at(index.row())->isExportEnabled() ? Qt::Checked : Qt::Unchecked;
37 }
38 }
39 }
40 return QVariant();
41}
QIcon loadIcon(const QString &name)
References KisIconUtils::loadIcon(), and m_compositions.
◆ flags()
| Qt::ItemFlags CompositionModel::flags |
( |
const QModelIndex & | index | ) |
const |
|
override |
Definition at line 79 of file compositionmodel.cpp.
80{
81 Qt::ItemFlags
flags = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable;
83}
Qt::ItemFlags flags(const QModelIndex &index) const override
References flags().
◆ headerData()
| QVariant CompositionModel::headerData |
( |
int | section, |
|
|
Qt::Orientation | orientation, |
|
|
int | role = Qt::DisplayRole ) const |
|
override |
◆ rowCount()
| int CompositionModel::rowCount |
( |
const QModelIndex & | parent = QModelIndex() | ) |
const |
|
override |
◆ setCompositions()
◆ setData()
| bool CompositionModel::setData |
( |
const QModelIndex & | index, |
|
|
const QVariant & | value, |
|
|
int | role = Qt::EditRole ) |
|
override |
Definition at line 43 of file compositionmodel.cpp.
44{
45 if (index.isValid()) {
46 if (role == Qt::CheckStateRole) {
49 if (index.column() == 0) {
50 bool exportEnabled =
value.toInt() == Qt::Checked;
52 if (layerComposition) {
53 layerComposition->setExportEnabled(exportEnabled);
54 }
55 }
56 }
57 return true;
58 }
59 return false;
60}
float value(const T *src, size_t ch)
int columnCount(const QModelIndex &parent=QModelIndex()) const override
int rowCount(const QModelIndex &parent=QModelIndex()) const override
References columnCount(), m_compositions, rowCount(), and value().
◆ m_compositions
The documentation for this class was generated from the following files: