I forgot to mention that I have also QWidgetMapper connected to add and edit comments, but I'm not sure if it is possible to pass data to model with QIdentityProxyModel.
Second thing is that I don't know how can I get infromation about number of column to insert data, for instance I've got three columns in model: value a, value b and comment. I want to add two columns: a+b and a*b. Problem is that I get only indexes from model and the rest of them are invalid, so it's not possible for me to distinguish column.
{
if (index.column()>=0) { // Here I get invalid number of column
} else {
return dataFromCell;
}
}
QVariant proxyCalcColumn::data(const QModelIndex &index, int role) const
{
QString tempString("Yo");
QVariant dataFromCell(tempString);
if (index.column()>=0) { // Here I get invalid number of column
return QSortFilterProxyModel::data(index, role);
} else {
return dataFromCell;
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks