Results 1 to 3 of 3

Thread: QSqlRelationalTableModel

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSqlRelationalTableModel

    The first question is whether the design of your database is correct. You could safely merge those two tables into a single one. As for the relational table model, it can't do what you want. You could implement a proxy that would merge two tables or create a view in your database and use QSqlTableModel or use QSqlQueryModel to fetch both tables. Just remember the latter is read-only.

  2. The following user says thank you to wysota for this useful post:

    marvin (19th November 2008)

  3. #2
    Join Date
    Nov 2008
    Location
    Croatia
    Posts
    4
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSqlRelationalTableModel

    Quote Originally Posted by wysota View Post
    The first question is whether the design of your database is correct. You could safely merge those two tables into a single one. As for the relational table model, it can't do what you want. You could implement a proxy that would merge two tables or create a view in your database and use QSqlTableModel or use QSqlQueryModel to fetch both tables. Just remember the latter is read-only.
    tnx, i can't merge the tables, those were just for example, but using QSqlQueryModel solved my problem

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
  •  
Qt is a trademark of The Qt Company.