Hi all,
I want to use multi-relation in a QTableView to follow more than only 1 relation. Do you know if is it possible ?
Let me explain with an example :
There are 3 Table : User - Town and Country like this :
------------------ ------------------ ------------------
| USER | | TOWN | | COUNTRY |
------------------ ------------------ ------------------
| user_id | |-->| town_ID | |-->| Country_id |
| Name | | | Name | | | Name |
| town_link |---| | Country_link |---| | |
| | | | | |
------------------ ------------------ ------------------
------------------ ------------------ ------------------
| USER | | TOWN | | COUNTRY |
------------------ ------------------ ------------------
| user_id | |-->| town_ID | |-->| Country_id |
| Name | | | Name | | | Name |
| town_link |---| | Country_link |---| | |
| | | | | |
------------------ ------------------ ------------------
To copy to clipboard, switch view to plain text mode
And this is that i want to display in my QTableView using a QSqlRelationalTableModel :
---------------------------------------------------
| USER | TOWN | COUNTRY |
---------------------------------------------------
| john | Londres | Angleterre |
| paul | Lyon | France |
| truc | Paris | France |
| pierre | Lausane | Suisse |
| jasmin | Oslo | Norvège |
| dan | Cupertino | USA |
---------------------------------------------------
---------------------------------------------------
| USER | TOWN | COUNTRY |
---------------------------------------------------
| john | Londres | Angleterre |
| paul | Lyon | France |
| truc | Paris | France |
| pierre | Lausane | Suisse |
| jasmin | Oslo | Norvège |
| dan | Cupertino | USA |
---------------------------------------------------
To copy to clipboard, switch view to plain text mode
Is it possible to do that only with QTableView and QSql(Relational)TableModel ?
Thanks
jjay
Bookmarks