#include <qxrdmasklistmodel.h>
Definition at line 7 of file qxrdmasklistmodel.h.
Enumerator |
---|
VisibilityColumn |
|
ThumbnailColumn |
|
TitleColumn |
|
NumColumns |
|
Definition at line 27 of file qxrdmasklistmodel.h.
int QxrdMaskListModel::columnCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
|
virtual |
QVariant QxrdMaskListModel::data |
( |
const QModelIndex & |
index, |
|
|
int |
role |
|
) |
| const |
|
virtual |
Definition at line 27 of file qxrdmasklistmodel.cpp.
References columnCount(), m_MaskStack, ThumbnailColumn, TitleColumn, and VisibilityColumn.
29 if (index.row() < 0 || index.row() >=
m_MaskStack->count()) {
36 int col = index.column();
40 if (role == Qt::DecorationRole) {
41 return p->thumbnailImage();
42 }
else if (role == Qt::CheckStateRole) {
43 return (p->get_Used()?Qt::Checked:Qt::Unchecked);
44 }
else if (role == Qt::DisplayRole || role == Qt::EditRole) {
46 return p->get_Title();
51 if (role == Qt::DecorationRole) {
52 return p->thumbnailImage();
53 }
else if (role == Qt::SizeHintRole) {
54 return p->thumbnailImageSize();
57 if (role == Qt::CheckStateRole) {
58 return (p->get_Used()?Qt::Checked:Qt::Unchecked);
59 }
else if (role == Qt::SizeHintRole) {
63 if (role == Qt::DisplayRole || role == Qt::EditRole) {
64 return p->get_Title();
65 }
else if (role==Qt::SizeHintRole) {
QxrdMaskStackPtr m_MaskStack
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Qt::ItemFlags QxrdMaskListModel::flags |
( |
const QModelIndex & |
index | ) |
const |
|
virtual |
Definition at line 99 of file qxrdmasklistmodel.cpp.
101 if (!index.isValid()) {
102 return QAbstractItemModel::flags(index) | Qt::ItemIsDropEnabled;
105 return QAbstractItemModel::flags(index) | Qt::ItemIsSelectable |Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsUserCheckable;
QVariant QxrdMaskListModel::headerData |
( |
int |
section, |
|
|
Qt::Orientation |
orientation, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
|
virtual |
bool QxrdMaskListModel::insertRows |
( |
int |
row, |
|
|
int |
count, |
|
|
const QModelIndex & |
parent = QModelIndex() |
|
) |
| |
|
virtual |
Definition at line 108 of file qxrdmasklistmodel.cpp.
110 printf(
"QxrdMaskListModel::insertRows(%d,%d,...)\n", row, count);
void QxrdMaskListModel::onMaskChanged |
( |
| ) |
|
|
slot |
bool QxrdMaskListModel::removeRows |
( |
int |
row, |
|
|
int |
count, |
|
|
const QModelIndex & |
parent = QModelIndex() |
|
) |
| |
|
virtual |
Definition at line 115 of file qxrdmasklistmodel.cpp.
117 printf(
"QxrdMaskListModel::removeRows(%d,%d,...)\n", row, count);
int QxrdMaskListModel::rowCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
|
virtual |
bool QxrdMaskListModel::setData |
( |
const QModelIndex & |
index, |
|
|
const QVariant & |
value, |
|
|
int |
role = Qt::EditRole |
|
) |
| |
|
virtual |
Definition at line 122 of file qxrdmasklistmodel.cpp.
References columnCount(), m_MaskStack, TitleColumn, and VisibilityColumn.
125 if (index.column() == 0) {
126 if ((index.row() >= 0) && (index.row() <
m_MaskStack->count())) {
129 if ((role == Qt::EditRole || role == Qt::DisplayRole)) {
131 p->set_Title(value.toString());
134 emit dataChanged(index, index);
139 if ((role == Qt::CheckStateRole)) {
141 p->set_Used(!(p->get_Used()));
144 emit dataChanged(index, index);
151 if ((index.row() >= 0) && (index.row() <
m_MaskStack->count())) {
154 if (index.column() ==
TitleColumn && (role == Qt::EditRole || role == Qt::DisplayRole)) {
156 p->set_Title(value.toString());
159 emit dataChanged(index, index);
166 p->set_Used(!(p->get_Used()));
169 emit dataChanged(index, index);
QxrdMaskStackPtr m_MaskStack
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Qt::DropActions QxrdMaskListModel::supportedDropActions |
( |
| ) |
const |
|
virtual |
Definition at line 183 of file qxrdmasklistmodel.cpp.
185 return QAbstractItemModel::supportedDropActions() | Qt::MoveAction;
The documentation for this class was generated from the following files: