38 : QAbstractItemModel (parent)
50 return Headers_.size ();
56 return Items_ [index.row ()]->Data (index.column (), role);
58 return QVariant::fromValue<void*> (Items_ [index.row ()]);
63 return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
68 if (orient != Qt::Horizontal ||
69 role != Qt::DisplayRole)
72 return Headers_.at (section);
77 if (parent.isValid () ||
78 !hasIndex (row, column))
79 return QModelIndex ();
81 return createIndex (row, column);
86 return QModelIndex ();
91 return index.isValid () ? 0 : Items_.size ();
99 beginInsertRows (QModelIndex (), pos, pos);
100 Items_.insert (pos, item);
106 int pos = Items_.indexOf (item);
109 qWarning () << Q_FUNC_INFO
115 beginRemoveRows (QModelIndex (), pos, pos);
116 Items_.removeAt (pos);
122 beginRemoveRows (QModelIndex (), pos, pos);
123 Items_.removeAt (pos);
129 int pos = Items_.indexOf (item);
132 qWarning () << Q_FUNC_INFO
143 emit dataChanged (
index (pos, 0),
ListModel(const QStringList &=QStringList(), QObject *=0)
void Remove(ListModelItem *)
void SetHeaders(const QStringList &)
void Update(ListModelItem *)
Qt::ItemFlags flags(const QModelIndex &) const
int columnCount(const QModelIndex &=QModelIndex()) const
void Insert(ListModelItem *, int=-1)
QModelIndex index(int, int, const QModelIndex &=QModelIndex()) const
QList< T * > GetItems() const
int rowCount(const QModelIndex &=QModelIndex()) const
QModelIndex parent(const QModelIndex &) const
QVariant headerData(int, Qt::Orientation, int=Qt::DisplayRole) const
QVariant data(const QModelIndex &, int=Qt::DisplayRole) const