1
What do I do to list two table data on tableView?
Sqlite Database(Example):
tb_venda
tb_produto
tb_valor
tb_cliente_id (Id do cliente "tb_cliente")
tb_cliente
tb_cliente_id (id primary key)
tb_nome
tb_estado
With QSqlRelationalTableModel
I can only carry the client’s name.
I also need the state.
relacao = new QSqlRelationalTableModel(this);
relacao->setTable("tb_venda");
relacao->setRelation(2, QSqlRelation("tb_cliente", "tb_cliente_id", "tb_nome"));
relacao->select();
ui->tableView->setModel(relacao);