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

QLineEdit background is not inherited from parent's explicitly set palette

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.11
    • Widgets: Styles
    • None
    • Windows

    Description

      On WindowsVista style. Works with Fusion and Windows.

      See https://codereview.qt-project.org/#/c/222324/ for a fix.

      Although not all styles are forced to obey the palette, here it seems like an oversight.

      #include <QtWidgets>
      #include <QDebug>
      
      
      int main (int a, char **b)
      {
          QApplication app(a, b);
          QWidget w;
          auto lay = new QVBoxLayout(&w);
          auto le = new QLineEdit(&w);
      
          QPalette palette = w.palette();
          palette.setColor(QPalette::Active, QPalette::Base, Qt::blue);
          w.setPalette(palette);
      
          lay->addWidget(le);
          w.resize(600, 600);
          w.show();
      
          return app.exec();
      }
      
      

       

      Attachments

        1. test-case.zip
          1 kB
        2. qtbug66911.zip
          2 kB

        Issue Links

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

          Activity

            People

              iamsergio Sergio Martins
              iamsergio Sergio Martins
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes