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

Stylesheet propagates to child widget but isn't getable with QWidget::styleSheet()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P2: Important P2: Important
    • None
    • 6.8.2, 6.8.4
    • Widgets: Style Sheets
    • None
    • Windows

      After giving a stylesheet to a widget using QWidget::setStyleSheet that style gets applied to this widget and all it's eventual children, as expected.

      But, while calling QWidget::styleSheet in the parent widget returns the stylesheet as expected, doing this call in one of it's children returns an empty string instead. 

      This issue can easily be dodged by manually calling setStyleSheet inside the parent widget after creating a child widget. Even then, the stylesheet remains un-getable in the constructor.

       

      I have included a couple of small source files to easily reproduce the issue.

        1. Stylesheet_bug.zip
          3.95 MB
          Paul LAURUOL
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            pll3 Paul LAURUOL
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes