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 show content of another cell in QTableView in italics on condition?
QtWS25 Last Chance

[SOLVED] How to show content of another cell in QTableView in italics on condition?

Scheduled Pinned Locked Moved General and Desktop
qtableview
2 Posts 2 Posters 678 Views
  • 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 table(id, name_first, name_second) and ComboBox. On ComboBox currentIndexChanged(int) i hide or show specific column of QTableView.
    Like this:

    |id|name_first
    |1 | "first"
    |2 | "second"
    |3 | "third"
    

    Some of the name_second cells may be empty
    And when combobox is changed to other value i see:

    |id|name_second
    |1 | "one"
    |2 | ""
    |3 | "three"
    

    In 2nd row i want display content of name_first column in italics.
    I think i will need to derive from QTableView but what should I override?

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

      Hi,

      That would rather be something to do in the your model or using a QIdentityProxyModel

      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