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. How Can I force call QHeaderView::paintSection?

How Can I force call QHeaderView::paintSection?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qheaderviewpaint
4 Posts 3 Posters 469 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.
  • L Offline
    L Offline
    leonardo M B
    wrote on last edited by leonardo M B
    #1

    So I have a customized paintSection implemented. I implemented in a way that always that I change a certain cell in my table view, the associated headers change the color.
    The problem is that now I'm using cells with checkboxes and when I change the state of the checkbox the paintSection is not called. If I hover the headers the paintSection is called and the color is applyed, but if I only check the state of the cell, its value change, but paintSection is not called, How can I force it?

    Christian EhrlicherC 1 Reply Last reply
    0
    • L leonardo M B

      So I have a customized paintSection implemented. I implemented in a way that always that I change a certain cell in my table view, the associated headers change the color.
      The problem is that now I'm using cells with checkboxes and when I change the state of the checkbox the paintSection is not called. If I hover the headers the paintSection is called and the color is applyed, but if I only check the state of the cell, its value change, but paintSection is not called, How can I force it?

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @leonardo-M-B said in How Can I force call QHeaderView::paintSection?:

      that I change a certain cell in my table view, the associated headers change the color.

      Connect the dataChanged() signal and emit headerDataChanged() in the slot depending on the changes or directly emit headerDataChanged().

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      L 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        @leonardo-M-B said in How Can I force call QHeaderView::paintSection?:

        that I change a certain cell in my table view, the associated headers change the color.

        Connect the dataChanged() signal and emit headerDataChanged() in the slot depending on the changes or directly emit headerDataChanged().

        L Offline
        L Offline
        leonardo M B
        wrote on last edited by
        #3

        @Christian-Ehrlicher Good Idea, but How Can I get the logicalFirst and logicalLast that the headerDataChanged require? I mean, dataChanged sends two QModelIndex

        JonBJ 1 Reply Last reply
        0
        • L leonardo M B

          @Christian-Ehrlicher Good Idea, but How Can I get the logicalFirst and logicalLast that the headerDataChanged require? I mean, dataChanged sends two QModelIndex

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @leonardo-M-B
          Pass topLeft.column(), bottomRight.column() on to headerDataChanged()?

          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