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

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

XMLWordPrintable

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

      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();
      }
      
      

       

        1. test-case.zip
          1 kB
        2. qtbug66911.zip
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

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

              Created:
              Updated:

                There are no open Gerrit changes