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

setting stylesheet more than once before showing the widget causes resetting stylesheet doesn't work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P4: Low P4: Low
    • 5.3.0
    • 4.7.2
    • Widgets: Style Sheets
    • None
    • 9babaac16da14657ccf8629419328bf05c866eed

      in the following test case, setStyleSheet is called twice.
      Then setting the stylesheet with an empty string doesn't reset the widget stylesheet.

      #include <QtGui>
      int main(int argc, char *argv[])
      {
         QApplication a(argc, argv);
         QLineEdit edit;
              //edit.ensurePolished();//this line can be used as workaround for this issue
              edit.setStyleSheet("QLineEdit{background-color:blue;}");
              edit.setStyleSheet("QLineEdit{background-color:red;}");
              edit.setStyleSheet("");
         edit.show();
         return a.exec();
      }

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

            andysh Andy Shaw
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes