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

Improper styling of placeholder text in Qt6

    XMLWordPrintable

Details

    • Linux/X11, macOS, Windows
    • ebf733c6fb (qt/qtbase/dev) ebf733c6fb (qt/tqtc-qtbase/dev) 0c37eec195 (qt/tqtc-qtbase/6.2) f6cf0e9926 (qt/qtbase/6.3) f6cf0e9926 (qt/tqtc-qtbase/6.3) 69b1b91e0d (qt/qtbase/6.4) 69b1b91e0d (qt/tqtc-qtbase/6.4)

    Description

      When applying style sheet to QTextEdit widget, placeholder text doesn't have reduced transparency as in Qt5 anymore. It will have same alpha value as foreground color.

      Minimal example is attached. When built with Qt 5.15.2, placeholder has proper alpha value. With Qt6, it is fully opaque.

       

      prime suspect is QRenderRule::configurePalette(...) in qstylesheetstyle.cpp, line 1511 (Qt 6.3.1):

      p->setBrush(cg, QPalette::PlaceholderText, pal->foreground);

      This call is not there in Qt 5.15.2

      Attachments

        1. scr_qt5.png
          scr_qt5.png
          5 kB
        2. scr_qt6.png
          scr_qt6.png
          5 kB
        3. TextEditExample.zip
          0.7 kB
        For Gerrit Dashboard: QTBUG-105049
        # Subject Branch Project Status CR V

        Activity

          People

            axelspoerl Axel Spoerl
            vk Vakhtang Khelashvili
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes