Thank you for your guiding. I finally solved with the following:
Qt Code:
  1. QVariant ModelLProd::data(const QModelIndex &index, int role) const
  2. {
  3. QVariant value = QSqlQueryModel::data(index, role);
  4. if (value.isValid() && role == Qt::DisplayRole && index.column() == 9) {
  5. int rand=index.row();
  6. int val=index.sibling(rand,8).data().toInt();
  7. if(val==99){
  8. return value.toString().replace(value.toString(),"0.00");
  9. }
  10. }
  11. return value;
  12. }
To copy to clipboard, switch view to plain text mode 

I was looking at the issue the wrong way.