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

Regression: QStyledItemDelegate get wrong rect size for painting

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.8.0
    • 4.8.0
    • Widgets: Itemviews
    • None
    • Reproduciable on both Windows and Linux
    • 4c64464ddf63ed89603ad759ffb68c6f298edd26

    Description

      The rectangle passed in QStyledItemDelegate::paint via option.rect is wrongly not adjusted for the vertical scrollbar if the horizontal scroll bar policy is always off.

      This triggers a bug in Creator, where we set the horizontal scroll bar to off and paint the whole rect ourselves, see the linked bug report.
      A small test case is attached, showing two listviews, with a delegate outputting the option.rect.width(). Both listviews have the same width, but due to the different number of items, one has a scrollbar, whereas the other has no scrollbar. Thus the output by the delegates should differ by the width of the scrollbar. It doesn't though.

      This was broken by commit: d91a8f3a5dbcf3e4c4c0afb28463b25e192b00e4 which is only part of qt 4.8 and not in qt 4.7.4

      Attachments

        Issue Links

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

          Activity

            People

              bachewii Jens
              dt Daniel Teske
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes