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

Wrong position used by drawControl() in QStyleItemDelegate::paint

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.11.2
    • Widgets: Itemviews
    • None
    • MacOS 10.14
    • macOS

    Description

      I have an item delegate derived from QStyledItemDelegate, which draws a QPushButton. It is drawn using:
      {{
      QApplication::style()->drawControl(QStyle::CE_PushButton, &button, painter);
      }}

      This works correctly on Mac using Qt 5.9.6 and on Windows.

      On Mac using Qt 5.11.2 the button is misplaced. It looks like some offset is added to the button.

      Similar behaviour can be observed when drawing a combo box.

      Attachments

        1. ButtonDelegate.zip
          3 kB
        2. qt5.11.2.png
          qt5.11.2.png
          49 kB
        3. qt5.9.6.png
          qt5.9.6.png
          50 kB
        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
            badbishop Michal
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes