34
35
ExtraRowProxyModel(QObject *parent = 0);
37
* Append a row, returns a row id
41
void setRowData(int id, int column, const QVariant &value, int role);
42
void setRowText(int id, int column, const QVariant &value);
44
37
int rowCount(const QModelIndex &parent = QModelIndex()) const; // reimp
45
38
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; // reimp
47
40
void setSourceModel(QAbstractItemModel* model);
42
/** Returns a pointer to the extra row model, which can be edited as appropriate*/
43
QStandardItemModel* extraRowModel() const;
50
46
void onSourceRowsInserted(const QModelIndex &parent,int start,int end);
51
47
void onSourceRowsRemoved(const QModelIndex &parent,int start,int end);
52
48
void onSourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
50
void onExtraRowsInserted(const QModelIndex &parent,int start,int end);
51
void onExtraRowsRemoved(const QModelIndex &parent,int start,int end);
52
void onExtraDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
55
56
typedef QHash<int, QVariant> Item; //role, item.
56
57
typedef QHash<int, Item> Row; //column, item
57
58
typedef QVector<Row> Rows;
60
int sourceRowCount() const;
59
62
QWeakPointer<QAbstractItemModel> m_model;
63
QStandardItemModel *m_extraRowModel;