[Breeze] [Bug 428973] New: Border one pixel off when drawing 'QStyle::PE_Frame' primitive using Breeze style

Michael Weghorn bugzilla_noreply at kde.org
Wed Nov 11 13:07:51 GMT 2020


https://bugs.kde.org/show_bug.cgi?id=428973

            Bug ID: 428973
           Summary: Border one pixel off when drawing 'QStyle::PE_Frame'
                    primitive using Breeze style
           Product: Breeze
           Version: 5.17.5
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: QStyle
          Assignee: unassigned-bugs at kde.org
          Reporter: m.weghorn at posteo.de
  Target Milestone: ---

Created attachment 133230
  --> https://bugs.kde.org/attachment.cgi?id=133230&action=edit
Small sample program

SUMMARY

When drawing a frame border/outline using

    QApplication::style()->drawPrimitive(QStyle::PE_Frame,...)

with the Breeze style, the border is not drawn at the outer edge of the
rectangle being passed, but an additional pixel "too far inside" of the
rectangle.

This e.g. leads to borders not being shown correctly when LibreOffice is used
with the qt5/kf5 integration (s. details below.)


STEPS TO REPRODUCE

1. Compile attached sample program "main.cpp"
2. run it (it creates an image file in /tmp/frame.png)
3. open the file /tmp/frame.png and check the position and total size of the
rectangle, including the border

OBSERVED RESULT

* The rectangle border starts at pixel (6,6).
* The rectangle (including the border) has a width and height of 8 pixels.

EXPECTED RESULT

Since the rect that was specified in the option as a 'QRect(5, 5, 10, 10)':

* The rectangle border should start at pixel (5,5).
* The rectangle (including the border) should have a width of and height of 10
pixels

SOFTWARE/OS VERSIONS

Operating System: Debian GNU/Linux 
KDE Plasma Version: 5.17.5
KDE Frameworks Version: 5.74.0
Qt Version: 5.15.1
Kernel Version: 5.9.0-1-amd64
OS Type: 64-bit
Processors: 12 × Intel® Core™ i7-9850H CPU @ 2.60GHz
Memory: 62.4 GiB of RAM

ADDITIONAL INFORMATION

* The border is placed as expected when using the Fusion style instead (e.g. by
setting env variable QT_STYLE_OVERRIDE=Fusion).

* The border is placed as expected when using a QStyle::PE_FrameWindow
primitive instead of QStyle::PE_Frame.

* Tested with Breeze style 5.17.5 from Debian packages as well as current git
master (as of c06b43dc99d68543f6f100517883620f60028f9c).

* This bug report is based on LibreOffice bug reports
https://bugs.documentfoundation.org/show_bug.cgi?id=138010 and
https://bugs.documentfoundation.org/show_bug.cgi?id=137956. The issue described
here leads to various borders not being shown when LibreOffice is used with the
qt5/kf5 integration and the Breeze style. From my analysis, it's a bug in the
Breeze theme, I plan to submit a merge request to fix this soon.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Unassigned-bugs mailing list