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. selection background color in TableWidget style sheet not working anymore

selection background color in TableWidget style sheet not working anymore

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 480 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.
  • JoeCFDJ Offline
    JoeCFDJ Offline
    JoeCFD
    wrote on last edited by JoeCFD
    #1

    I have the following style sheet for Qtablewidget:
    QTableView{outline:0;selection-color: black; selection-background-color:green;}
    This works fine on Ubuntu 18 with 5.15.2. It is not working anymore on Ubuntu 22.04 with 5.15.3.
    Anyone has the same problem?

    jsulmJ 1 Reply Last reply
    0
    • JoeCFDJ JoeCFD

      I have the following style sheet for Qtablewidget:
      QTableView{outline:0;selection-color: black; selection-background-color:green;}
      This works fine on Ubuntu 18 with 5.15.2. It is not working anymore on Ubuntu 22.04 with 5.15.3.
      Anyone has the same problem?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @JoeCFD said in selection background color in TableWidget style sheet not working anymore:

      QTableView{outline:0;selection-color: black; selection-background-color:green;}

      Shouldn't it be QTableWidget?

      "It is not working anymore" - what exactly does not work?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by JoeCFD
        #3

        green color is not displayed. QTableWidget inherits QTableView.

        1 Reply Last reply
        0
        • JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by
          #4

          I can make it working again by enforcing this style sheet when any row is selected. But this should not be needed.

          1 Reply Last reply
          0
          • JoeCFDJ Offline
            JoeCFDJ Offline
            JoeCFD
            wrote on last edited by
            #5

            Resetting style sheet solves the problem when a row is selected. Although it is not a good solution. I will mark it as solved.

            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