Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MultipleModels/oneView
Qt 6.11 is out! See what's new in the release blog

MultipleModels/oneView

Scheduled Pinned Locked Moved General and Desktop
21 Posts 14 Posters 24.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S seyed

    @plinioandrade said in MultipleModels/oneView:

    Hey Volker,
    I don't understand why you said it's confusing and not usual! Let's say I have a table for customer and other one for address and the address table has some fields like 'zip_code', 'city','state' and so on. What should I do if I want to show a TableView with the complete information about customers? The QSqlRelationalTableModel just allow me to link a foreign key to a field on other table but in fact I want to link one foreign key to other table and show all fields of that table. Does someone have a solution?

    Any solution?

    VRoninV Offline
    VRoninV Offline
    VRonin
    wrote on last edited by
    #21

    @seyed Write the SQL query with all the relations you need and run it using QSqlQuery then populate a QStandardItemModel with the results

    "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
    ~Napoleon Bonaparte

    On a crusade to banish setIndexWidget() from the holy land of Qt

    1 Reply Last reply
    1

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved