Qt – How to add calculated column in QsqlRelationalTableModel ?

Posted by user289175 on Stack Overflow See other posts from Stack Overflow or by user289175
Published on 2010-04-10T03:48:36Z Indexed on 2010/04/10 3:53 UTC
Read the original article Hit count: 261

Filed under:

I have an table view showed

part description, quantity, price

And I have a Model/View using this code

model = new QSqlRelationalTableModel(this);
model->setTable("parts");
model->setRelation(3,QSqlRelation("part_tbl","part_id","part_desc"));

model->select();
ui->tableView->setModel(model);

I need to add a new column that shows quantity * price in the table view. It's important to know I'm using QsqlRelationalTableModel

Help is appreciated, Thanks in advance

© Stack Overflow or respective owner

Related posts about qt