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. [solved]Mapping a QComboBox displaying multiple columns
Forum Updated to NodeBB v4.3 + New Features

[solved]Mapping a QComboBox displaying multiple columns

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.8k 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.
  • P Offline
    P Offline
    p91paul
    wrote on last edited by
    #1

    hi everybody,
    I'm using a QSqlRelationalTableModel with a QWidgetMapper.
    For a field I need to show in a combo box name and surname that are in two different columns of the table, but I have to select only one ModelColumn of the model;
    I know I can use a QSqlQueryModel with a concat, but doesn't it break the mapping if I don't use model->relationModel() as the combobox model?
    thank you
    Paolo

    1 Reply Last reply
    0
    • L Offline
      L Offline
      ludde
      wrote on last edited by
      #2

      Haven't used any of those classes, but it looks like something you might want to create a "QAbstractProxyModel":http://doc.qt.nokia.com/latest/qabstractproxymodel.html subclass for.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        p91paul
        wrote on last edited by
        #3

        what a wonderful thing I've discovered! =D thanks a lot

        1 Reply Last reply
        0

        • Login

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