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
Forum Update on Monday, May 27th 2025

<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 30 Apr 2015, 13:46 last edited by GrahamL 5 Jun 2015, 07:54
    #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
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 2 May 2015, 22:11 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 5 May 2015, 08:50 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 5 May 2015, 08:52 last edited by
          #4

          How do I mark the topic solved?

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 5 May 2015, 23:31 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

            1/5

            30 Apr 2015, 13:46

            • Login

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