#include <qxrdmaskstackmodel.h>
Definition at line 7 of file qxrdmaskstackmodel.h.
Enumerator |
---|
VisibilityColumn |
|
ThumbnailColumn |
|
TitleColumn |
|
NumColumns |
|
Definition at line 27 of file qxrdmaskstackmodel.h.
int QxrdMaskStackModel::columnCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
|
virtual |
QVariant QxrdMaskStackModel::data |
( |
const QModelIndex & |
index, |
|
|
int |
role |
|
) |
| const |
|
virtual |
Definition at line 29 of file qxrdmaskstackmodel.cpp.
References columnCount(), m_MaskStack, ThumbnailColumn, TitleColumn, and VisibilityColumn.
31 if (index.row() < 0 || index.row() >=
m_MaskStack->count()) {
38 int col = index.column();
42 if (role == Qt::DecorationRole) {
43 return p->thumbnailImage();
44 }
else if (role == Qt::CheckStateRole) {
45 return (p->get_Used()?Qt::Checked:Qt::Unchecked);
46 }
else if (role == Qt::DisplayRole || role == Qt::EditRole) {
48 return p->get_Title();
53 if (role == Qt::DecorationRole) {
54 return p->thumbnailImage();
55 }
else if (role == Qt::SizeHintRole) {
56 return p->thumbnailImageSize();
59 if (role == Qt::CheckStateRole) {
60 return (p->get_Used()?Qt::Checked:Qt::Unchecked);
61 }
else if (role == Qt::SizeHintRole) {
65 if (role == Qt::DisplayRole || role == Qt::EditRole) {
66 return p->get_Title();
67 }
else if (role==Qt::SizeHintRole) {
QxrdMaskStackPtr m_MaskStack
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
QSharedPointer< QcepMaskData > QcepMaskDataPtr
Qt::ItemFlags QxrdMaskStackModel::flags |
( |
const QModelIndex & |
index | ) |
const |
|
virtual |
Definition at line 101 of file qxrdmaskstackmodel.cpp.
103 if (!index.isValid()) {
104 return QAbstractItemModel::flags(index) | Qt::ItemIsDropEnabled;
107 return QAbstractItemModel::flags(index) | Qt::ItemIsSelectable |Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsUserCheckable;
QVariant QxrdMaskStackModel::headerData |
( |
int |
section, |
|
|
Qt::Orientation |
orientation, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
|
virtual |
bool QxrdMaskStackModel::insertRows |
( |
int |
row, |
|
|
int |
count, |
|
|
const QModelIndex & |
parent = QModelIndex() |
|
) |
| |
|
virtual |
Definition at line 110 of file qxrdmaskstackmodel.cpp.
112 printf(
"QxrdMaskStackModel::insertRows(%d,%d,...)\n", row, count);
void QxrdMaskStackModel::onMaskChanged |
( |
| ) |
|
|
slot |
bool QxrdMaskStackModel::removeRows |
( |
int |
row, |
|
|
int |
count, |
|
|
const QModelIndex & |
parent = QModelIndex() |
|
) |
| |
|
virtual |
Definition at line 117 of file qxrdmaskstackmodel.cpp.
119 printf(
"QxrdMaskStackModel::removeRows(%d,%d,...)\n", row, count);
int QxrdMaskStackModel::rowCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
|
virtual |
bool QxrdMaskStackModel::setData |
( |
const QModelIndex & |
index, |
|
|
const QVariant & |
value, |
|
|
int |
role = Qt::EditRole |
|
) |
| |
|
virtual |
Definition at line 124 of file qxrdmaskstackmodel.cpp.
References columnCount(), m_MaskStack, TitleColumn, and VisibilityColumn.
127 if (index.column() == 0) {
128 if ((index.row() >= 0) && (index.row() <
m_MaskStack->count())) {
131 if ((role == Qt::EditRole || role == Qt::DisplayRole)) {
133 p->set_Title(value.toString());
136 emit dataChanged(index, index);
141 if (role == Qt::CheckStateRole) {
143 p->set_Used(!(p->get_Used()));
146 emit dataChanged(index, index);
153 if ((index.row() >= 0) && (index.row() <
m_MaskStack->count())) {
156 if (index.column() ==
TitleColumn && (role == Qt::EditRole || role == Qt::DisplayRole)) {
158 p->set_Title(value.toString());
161 emit dataChanged(index, index);
168 p->set_Used(!(p->get_Used()));
171 emit dataChanged(index, index);
QxrdMaskStackPtr m_MaskStack
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
QSharedPointer< QcepMaskData > QcepMaskDataPtr
Qt::DropActions QxrdMaskStackModel::supportedDropActions |
( |
| ) |
const |
|
virtual |
Definition at line 185 of file qxrdmaskstackmodel.cpp.
187 return QAbstractItemModel::supportedDropActions() | Qt::MoveAction;
The documentation for this class was generated from the following files: