Hi,
I have a QTableView and set model QSqlQueryModel. I reimplement the function virtual data( ) and is functioning properly. The problem is that the first line is never applied what determines the method. How can I fix it?
{
if ((idx.row()) && (role == Qt::BackgroundRole) &&
(index(idx.row(), 9, idx.parent()).data().toInt() == 0))
{
}
return (v);
}
QVariant ChequesRecModel::data(const QModelIndex &idx, int role) const
{
QVariant v = QSqlQueryModel::data(idx, role);
if ((idx.row()) && (role == Qt::BackgroundRole) &&
(index(idx.row(), 9, idx.parent()).data().toInt() == 0))
{
return QVariant(QColor(Qt::yellow));
}
return (v);
}
To copy to clipboard, switch view to plain text mode
Thanks,
Marcelo E. Geyer
Brazil/RS
Bookmarks