6 #define TODO(d1,d2,s) m_Items.append(QxrdToDoListItemPtr(new QxrdToDoListItem(id++,true,d1,d2,s)));
7 #define DONE(d1,d2,s) m_Items.append(QxrdToDoListItemPtr(new QxrdToDoListItem(id++,false,d1,d2,s)));
10 : QAbstractListModel(parent)
29 int row = index.row();
30 int col = index.column();
34 if (role == Qt::DisplayRole && item) {
36 return item->identifier();
38 return item->isActive();
40 return item->insertedDate().date();
42 return item->completedDate().date();
44 return item->description();
46 }
else if (role == Qt::TextAlignmentRole) {
48 return QVariant(Qt::AlignHCenter | Qt::AlignTop);
50 return QVariant(Qt::AlignLeft | Qt::AlignTop);
64 if (orientation == Qt::Horizontal) {
65 if (role == Qt::DisplayRole) {
QVariant data(const QModelIndex &index, int role) const
QVector< QxrdToDoListItemPtr > m_Items
QSharedPointer< QxrdToDoListItem > QxrdToDoListItemPtr
QxrdToDoList(QObject *parent=NULL)
int rowCount(const QModelIndex &parent) const
QVariant headerData(int section, Qt::Orientation orientation, int role) const
int columnCount(const QModelIndex &parent) const