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

Details

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

    Description

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

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-18958
          # Subject Branch Project Status CR V

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes