PDA

View Full Version : Nullable foreign keys in QTableView



Banjo
25th January 2008, 05:13
Hello

I have a QSqlRelationalTableModel which is viewed using a QTableView and QSqlRelationalDelegate to give comboboxes for foreign key fields.

My question is how do I handle nullable foreign keys? If foreign key is null it is not being displayed in the QTableView and there seems to be no way of having a null value in a combo box.

Thanks in advance

Banjo
28th January 2008, 22:37
Hello
Is anyone able to help me??

jpn
31st January 2008, 17:43
I have no idea if it really works, but perhaps you could insert corresponding NULL values to those relational tables..

Banjo
31st January 2008, 23:07
Thanks for that. I had hoped to avoid inserting rows like that but I will give it a go