Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-72096

Setting background color to Tab reverts the Triangular shape back to Rounded

    XMLWordPrintable

Details

    • Windows
    • 3d8ed3ba969ba958401dbf5e6760cf0788f1888e (qt/qtbase/5.13)

    Description

      I am using a QTabWidget with a triangular tab shape. However, I want to change the background color of the selected tab to something else than the default, but I cannot because setting the background color for the selected tab reverts the triangular shape back to default rounded shape.

      I am using this style sheet

      QTabWidget {
          background-color: rgb(0, 0, 0);
          qproperty-tabShape: Triangular;
      }
      
      QTabBar::tab:selected {
          color: green;
          background-color: pink;
      }
      
      QTabBar::tab:!selected {
          color: red;
      }
      

      Please find the attached example project which demonstrates this effect. Also attached a screenshot of the end result

      Attachments

        1. tabs.png
          tabs.png
          7 kB
        2. TabWidgets.zip
          6 kB
        For Gerrit Dashboard: QTBUG-72096
        # Subject Branch Project Status CR V

        Activity

          People

            vgt Eirik Aavitsland
            pekarjal Pekka Karjalainen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes