PDA

View Full Version : QSqlRelationalTable and filters



manucorrales
19th July 2006, 17:13
Hi, i am using a QSqlRelationalTableModel like this:


modelo->setTable("producto");
modelo->setRelation(1, QSqlRelation("rubro", "idrubro", "nombre"));
modelo->select();

now after this i want to set a filter but with the related column, in this case the column rubro.nombre from the table rubro. How can i do this? Is this possible? Ive tryed several ways but is not working at all, i ve tried "rubro = sometext" "idrubro = idrubro" and a few more. Can anybody help me?

Thanks.

wysota
19th July 2006, 18:39
You have to pass the id and not the name or use a proxy model and do the filtering there.