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

Support for background-image: none

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 6.8.3
    • Widgets: Style Sheets
    • None
    • Windows

    Description

      The Style Sheet implementation does not support the standard CSS syntax "background-image: none" for removing background images. Qt's style sheet parser only allows background-image when the value is a Url and doesn't process the "none" value.

      I had a look at the style sheet parser code in qcssparser.cpp. It only sets background-image when it detects a `Value::Uri`, but doesn't have any handling for the "none" value.

      Workaround:
      Use "background-image: url();" in the CSS.

      Proposed Solution:
      Modify the style sheet parser in qcssparser.cpp to recognize "none" as a valid value for background-image and handle it appropriately by clearing any existing background image. Clarify this in the documentation (style sheets reference).

      Attachments

        1. image-2025-06-23-12-17-17-216.png
          32 kB
          Andreas Haferburg
        2. image-2025-06-23-12-18-09-883.png
          16 kB
          Andreas Haferburg
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            ahsyk Andreas Haferburg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes