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] How to join 3 columns into one?
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] How to join 3 columns into one?

Scheduled Pinned Locked Moved General and Desktop
qtableview
2 Posts 2 Posters 642 Views 2 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.
  • M Offline
    M Offline
    mkolenda
    wrote on last edited by mkolenda
    #1

    I have 3 columns in table(c1,c2,c3). I want to display them in one column, joined in specified way using QTableView or derived class on the data side i use QSqlRelationalTableModel.
    For example if c1 and c3 are present in the row. I want to to format them as:
    "[c1]dm3; [c3] mol/dm3". If only c2 is set i want to just display "[c2] grams".
    I want to affect only way the data is shown.
    What do you think about this?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Looks like a work for a QAbstractProxyModel derived class

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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