![]() |
LeechCraft
%{LEECHCRAFT_VERSION}
Modular cross-platform feature rich live environment.
|
#include "listmodel.h"
Public Types | |
enum | Roles { RolePointer = Qt::UserRole + 25 } |
Public Member Functions | |
ListModel (const QStringList &=QStringList(), QObject *=0) | |
virtual | ~ListModel () |
int | columnCount (const QModelIndex &=QModelIndex()) const |
QVariant | data (const QModelIndex &, int=Qt::DisplayRole) const |
Qt::ItemFlags | flags (const QModelIndex &) const |
QVariant | headerData (int, Qt::Orientation, int=Qt::DisplayRole) const |
QModelIndex | index (int, int, const QModelIndex &=QModelIndex()) const |
QModelIndex | parent (const QModelIndex &) const |
int | rowCount (const QModelIndex &=QModelIndex()) const |
void | Insert (ListModelItem *, int=-1) |
void | Remove (ListModelItem *) |
void | Remove (int) |
void | Update (ListModelItem *) |
void | Update (int) |
void | Clear () |
void | SetHeaders (const QStringList &) |
template<typename T > | |
QList< T * > | GetItems () const |
template<typename T > | |
T * | GetItem (const QModelIndex &index) const |
template<typename T > | |
T * | GetItem (int row) const |
template<> | |
QList< ListModelItem * > | GetItems () const |
Definition at line 47 of file listmodel.h.
Enumerator | |
---|---|
RolePointer |
Definition at line 54 of file listmodel.h.
LeechCraft::Util::ListModel::ListModel | ( | const QStringList & | headers = QStringList () , |
QObject * | parent = 0 |
||
) |
Definition at line 37 of file listmodel.cpp.
|
virtual |
Definition at line 43 of file listmodel.cpp.
void LeechCraft::Util::ListModel::Clear | ( | ) |
Definition at line 147 of file listmodel.cpp.
int LeechCraft::Util::ListModel::columnCount | ( | const QModelIndex & | = QModelIndex () | ) | const |
Definition at line 48 of file listmodel.cpp.
Referenced by Update().
QVariant LeechCraft::Util::ListModel::data | ( | const QModelIndex & | index, |
int | role = Qt::DisplayRole |
||
) | const |
Definition at line 53 of file listmodel.cpp.
References RolePointer.
Qt::ItemFlags LeechCraft::Util::ListModel::flags | ( | const QModelIndex & | ) | const |
Definition at line 61 of file listmodel.cpp.
|
inline |
Definition at line 90 of file listmodel.h.
|
inline |
Definition at line 96 of file listmodel.h.
|
inline |
Definition at line 81 of file listmodel.h.
QList< ListModelItem * > LeechCraft::Util::ListModel::GetItems | ( | ) | const |
Definition at line 159 of file listmodel.cpp.
QVariant LeechCraft::Util::ListModel::headerData | ( | int | section, |
Qt::Orientation | orient, | ||
int | role = Qt::DisplayRole |
||
) | const |
Definition at line 66 of file listmodel.cpp.
QModelIndex LeechCraft::Util::ListModel::index | ( | int | row, |
int | column, | ||
const QModelIndex & | parent = QModelIndex () |
||
) | const |
Definition at line 75 of file listmodel.cpp.
Referenced by Update().
void LeechCraft::Util::ListModel::Insert | ( | ListModelItem * | item, |
int | pos = -1 |
||
) |
Definition at line 94 of file listmodel.cpp.
QModelIndex LeechCraft::Util::ListModel::parent | ( | const QModelIndex & | ) | const |
Definition at line 84 of file listmodel.cpp.
void LeechCraft::Util::ListModel::Remove | ( | ListModelItem * | item | ) |
Definition at line 104 of file listmodel.cpp.
void LeechCraft::Util::ListModel::Remove | ( | int | pos | ) |
Definition at line 120 of file listmodel.cpp.
int LeechCraft::Util::ListModel::rowCount | ( | const QModelIndex & | index = QModelIndex () | ) | const |
Definition at line 89 of file listmodel.cpp.
void LeechCraft::Util::ListModel::SetHeaders | ( | const QStringList & | headers | ) |
Definition at line 153 of file listmodel.cpp.
void LeechCraft::Util::ListModel::Update | ( | ListModelItem * | item | ) |
Definition at line 127 of file listmodel.cpp.
void LeechCraft::Util::ListModel::Update | ( | int | pos | ) |
Definition at line 141 of file listmodel.cpp.
References columnCount(), and index().