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

QAbstractItemView, style sheet vs model: padding-left requires border implies color overrides BackgroundRole

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.6.2
    • GUI: Other
    • None

    Description

      A style sheet block `QAbstractItemView::item` causes the following cascade of issues:

      • `padding-left` is ignored unless a border as is set,
      • as soon as there is a border property, the style sheet takes control over colors,
      • colors set for the BackgroundRole in the model's data() function are henceforth ignored.

      The overriding of model settings by style sheet settings is such a long-standing problem that it must be considered no longer a bug, but a feature. A largely undocumented feature though. So I'd just suggest some explanation in the docs.

      Furthermore, I'd ask whether it is possible to break the above cascade at some other point:

      • make `padding-left` work even if there is no `border` property,
      • if the style sheet specifies border width and style, but not border color, then do not take over control control.

      Attachments

        Issue Links

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

          Activity

            People

              axelspoerl Axel Spoerl
              jwu Joachim Wuttke
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes