aguleo
27th May 2014, 22:00
Hello,
I have the table Items(id, idColor, other, ...)
To access this table i have :
model - QSqlRelationTableModel
view - QTableView
To get data from the current index i use:
qDebug() << model->data(indexField).toString();
This works fine, except for the field that are foreign keys (idColor), and that i used a QSqlRelationalDelegate. In this cases, instead of the id e get the related data (the color as a string), in the other table.
How can i get the data form the table (the id) and not the related data?
Thanks
I have the table Items(id, idColor, other, ...)
To access this table i have :
model - QSqlRelationTableModel
view - QTableView
To get data from the current index i use:
qDebug() << model->data(indexField).toString();
This works fine, except for the field that are foreign keys (idColor), and that i used a QSqlRelationalDelegate. In this cases, instead of the id e get the related data (the color as a string), in the other table.
How can i get the data form the table (the id) and not the related data?
Thanks