OpenMW
|
#include <idtable.hpp>
Public Types | |
enum | Reordering { Reordering_None, Reordering_WithinTopic } |
Public Member Functions | |
IdTable (CollectionBase *idCollection, Reordering reordering=Reordering_WithinTopic) | |
The ownership of idCollection is not transferred. | |
virtual | ~IdTable () |
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const |
virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const |
virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
virtual bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
virtual Qt::ItemFlags | flags (const QModelIndex &index) const |
virtual bool | removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
virtual QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const |
virtual QModelIndex | parent (const QModelIndex &index) const |
void | addRecord (const std::string &id, UniversalId::Type type=UniversalId::Type_None) |
QModelIndex | getModelIndex (const std::string &id, int column) const |
void | setRecord (const std::string &id, const RecordBase &record) |
Add record or overwrite existing recrod. | |
const RecordBase & | getRecord (const std::string &id) const |
int | searchColumnIndex (Columns::ColumnId id) const |
Return index of column with the given id. If no such column exists, -1 is returned. | |
int | findColumnIndex (Columns::ColumnId id) const |
void | reorderRows (int baseIndex, const std::vector< int > &newOrder) |
Reordering | getReordering () const |
Private Member Functions | |
IdTable (const IdTable &) | |
IdTable & | operator= (const IdTable &) |
Private Attributes | |
CollectionBase * | mIdCollection |
Reordering | mReordering |
CSMWorld::IdTable::IdTable | ( | const IdTable & | ) | [private] |
CSMWorld::IdTable::IdTable | ( | CollectionBase * | idCollection, |
Reordering | reordering = Reordering_WithinTopic |
||
) |
The ownership of idCollection is not transferred.
CSMWorld::IdTable::~IdTable | ( | ) | [virtual] |
void CSMWorld::IdTable::addRecord | ( | const std::string & | id, |
UniversalId::Type | type = UniversalId::Type_None |
||
) |
type | Will be ignored, unless the collection supports multiple record types |
int CSMWorld::IdTable::columnCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const [virtual] |
QVariant CSMWorld::IdTable::data | ( | const QModelIndex & | index, |
int | role = Qt::DisplayRole |
||
) | const [virtual] |
int CSMWorld::IdTable::findColumnIndex | ( | Columns::ColumnId | id | ) | const |
Return index of column with the given id. If no such column exists, an exception is thrown.
Qt::ItemFlags CSMWorld::IdTable::flags | ( | const QModelIndex & | index | ) | const [virtual] |
QModelIndex CSMWorld::IdTable::getModelIndex | ( | const std::string & | id, |
int | column | ||
) | const |
const CSMWorld::RecordBase & CSMWorld::IdTable::getRecord | ( | const std::string & | id | ) | const |
QVariant CSMWorld::IdTable::headerData | ( | int | section, |
Qt::Orientation | orientation, | ||
int | role = Qt::DisplayRole |
||
) | const [virtual] |
QModelIndex CSMWorld::IdTable::index | ( | int | row, |
int | column, | ||
const QModelIndex & | parent = QModelIndex() |
||
) | const [virtual] |
QModelIndex CSMWorld::IdTable::parent | ( | const QModelIndex & | index | ) | const [virtual] |
bool CSMWorld::IdTable::removeRows | ( | int | row, |
int | count, | ||
const QModelIndex & | parent = QModelIndex() |
||
) | [virtual] |
void CSMWorld::IdTable::reorderRows | ( | int | baseIndex, |
const std::vector< int > & | newOrder | ||
) |
Reorder the rows [baseIndex, baseIndex+newOrder.size()) according to the indices given in newOrder (baseIndex+newOrder[0] specifies the new index of row baseIndex).
int CSMWorld::IdTable::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const [virtual] |
int CSMWorld::IdTable::searchColumnIndex | ( | Columns::ColumnId | id | ) | const |
Return index of column with the given id. If no such column exists, -1 is returned.
bool CSMWorld::IdTable::setData | ( | const QModelIndex & | index, |
const QVariant & | value, | ||
int | role = Qt::EditRole |
||
) | [virtual] |
void CSMWorld::IdTable::setRecord | ( | const std::string & | id, |
const RecordBase & | record | ||
) |
Add record or overwrite existing recrod.
CollectionBase* CSMWorld::IdTable::mIdCollection [private] |
Reordering CSMWorld::IdTable::mReordering [private] |