Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    General and Desktop
    qtableview
    2
    2
    562
    Loading More Posts
    • 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
      mkolenda last edited by mkolenda

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 1
        • First post
          Last post