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> Adding an annotation to the header row in qtableview
QtWS25 Last Chance

<SOLVED> Adding an annotation to the header row in qtableview

Scheduled Pinned Locked Moved General and Desktop
qt 5.4tableview
5 Posts 2 Posters 1.5k 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.
  • G Offline
    G Offline
    GrahamL
    wrote on last edited by GrahamL
    #1

    Hi
    I have been given a requirement that on a table view there should be a small icon in addition to the heading text. This icon will appear and disappear depending on application state.
    Could anyone please give some pointers on how to implement this?

    Thanks

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

      Hi

      Since it's a QTableView, I suppose you have a custom model ? Unless I'm mistaken you can reimplement the headerData function and return an icon for the Qt::DecorationRole

      Hope it helps

      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
      0
      • G Offline
        G Offline
        GrahamL
        wrote on last edited by
        #3

        Thanks
        I'll give it a go when I get some time

        1 Reply Last reply
        0
        • G Offline
          G Offline
          GrahamL
          wrote on last edited by
          #4

          How do I mark the topic solved?

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

            Either using the Topic Tool menu or just edit the thread title prepending [solved]

            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
            0

            • Login

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