Results 1 to 4 of 4

Thread: Nullable foreign keys in QTableView

  1. #1
    Join Date
    Jan 2008
    Posts
    39
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Nullable foreign keys in QTableView

    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

  2. #2
    Join Date
    Jan 2008
    Posts
    39
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Nullable foreign keys in QTableView

    Hello
    Is anyone able to help me??

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Nullable foreign keys in QTableView

    I have no idea if it really works, but perhaps you could insert corresponding NULL values to those relational tables..
    J-P Nurmi

  4. The following user says thank you to jpn for this useful post:

    Banjo (31st January 2008)

  5. #4
    Join Date
    Jan 2008
    Posts
    39
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Nullable foreign keys in QTableView

    Thanks for that. I had hoped to avoid inserting rows like that but I will give it a go

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.