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

QLineEdit - placeholderText's wrong color in dark theme

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.9.0
    • Widgets: Styles
    • None
    • Linux Mint 22.1 Cinnamon with dark theme Mint-Y
    • Linux/X11
    • Linux/X11

    Description

      Hi,

      On Linux Mint (GTK X11) I'm using dark theme Mint-Y.

      Default Qt Project app with fusion style.

      In design time I see correct gray color of placeholdertext:

      But when I run app it is getting black:

      I asked it on Qt forum. Someone suggested to use PhantomStyle instead Fusion. But it had the same problem. Then he suggested to change palette color to something gray alike. When playing with this, I tried something for curiosity:

       

      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QPalette pal = QApplication::palette();
          pal.setColor(QPalette::PlaceholderText, pal.color(QPalette::PlaceholderText));
          QApplication::setPalette(pal);
          MainWindow w;
          w.show();
          return a.exec();
      }
      

      And this fixed the issue:

      Seems that QPalette::PlaceholderText color role is not initialized correctly in palette

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              tpochep Timur Pocheptsov
              kobid Kobid
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes