1 #ifndef CSM_WOLRD_IDTABLE_H
2 #define CSM_WOLRD_IDTABLE_H
34 virtual int rowCount (
const QModelIndex &
parent = QModelIndex())
const;
38 virtual QVariant
data (
const QModelIndex &
index,
int role = Qt::DisplayRole)
const;
40 virtual QVariant
headerData (
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const;
42 virtual bool setData (
const QModelIndex &
index,
const QVariant &value,
int role = Qt::EditRole);
44 virtual Qt::ItemFlags
flags (
const QModelIndex &
index)
const;
46 virtual bool removeRows (
int row,
int count,
const QModelIndex&
parent = QModelIndex());
48 virtual QModelIndex
index (
int row,
int column,
const QModelIndex&
parent = QModelIndex())
51 virtual QModelIndex
parent (
const QModelIndex&
index)
const;
61 const std::string& destination,
64 virtual QModelIndex
getModelIndex (
const std::string&
id,
int column)
const;
79 void reorderRows (
int baseIndex,
const std::vector<int>& newOrder);
83 virtual std::pair<UniversalId, std::string>
view (
int row)
const;
88 virtual bool isDeleted (
const std::string&
id)
const;
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Definition: idtable.cpp:97
CollectionBase * mIdCollection
Definition: idtable.hpp:21
void setRecord(const std::string &id, const RecordBase &record, UniversalId::Type type=UniversalId::Type_None)
Add record or overwrite existing record.
Definition: idtable.cpp:188
virtual QModelIndex getModelIndex(const std::string &id, int column) const
This method can return only indexes to the top level table cells.
Definition: idtable.cpp:183
Definition: idtable.hpp:15
virtual int searchColumnIndex(Columns::ColumnId id) const
Return index of column with the given id. If no such column exists, -1 is returned.
Definition: idtable.cpp:215
virtual QModelIndex parent(const QModelIndex &index) const
Definition: idtable.cpp:138
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: idtable.cpp:33
virtual int getColumnId(int column) const
Definition: idtable.cpp:275
void reorderRows(int baseIndex, const std::vector< int > &newOrder)
Definition: idtable.cpp:225
Type
Definition: universalid.hpp:40
IdTable & operator=(const IdTable &)
void cloneRecord(const std::string &origin, const std::string &destination, UniversalId::Type type=UniversalId::Type_None)
Definition: idtable.cpp:171
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: idtable.cpp:53
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: idtable.cpp:124
virtual ~IdTable()
Definition: idtable.cpp:14
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Definition: idtable.cpp:76
virtual bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
Definition: idtable.cpp:110
const RecordBase & getRecord(const std::string &id) const
Definition: idtable.cpp:210
Base class for record collections.
Definition: collectionbase.hpp:23
virtual int findColumnIndex(Columns::ColumnId id) const
Definition: idtable.cpp:220
ColumnId
Definition: columns.hpp:13
virtual CollectionBase * idCollection() const
Definition: idtable.cpp:280
Definition: idtablebase.hpp:12
Definition: universalid.hpp:42
virtual std::pair< UniversalId, std::string > view(int row) const
Definition: idtable.cpp:233
virtual bool isDeleted(const std::string &id) const
Is id flagged as deleted?
Definition: idtable.cpp:270
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition: idtable.cpp:25
void addRecord(const std::string &id, UniversalId::Type type=UniversalId::Type_None)
Definition: idtable.cpp:143
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: idtable.cpp:17
void addRecordWithData(const std::string &id, const std::map< int, QVariant > &data, UniversalId::Type type=UniversalId::Type_None)
Definition: idtable.cpp:154