Skip to content

Commit aabb8a0

Browse files
committed
Fixed obvious bug in untested code from QwtPainterClass.drawBackground
This closes #51
1 parent d2f77d5 commit aabb8a0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

qwt/painter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from .qt.QtGui import (QPaintEngine, QFrame, QPixmap, QPainter, QPalette,
2020
QStyle, QPen, QStyleOptionFocusRect, QBrush, QRegion,
2121
QLinearGradient, QPainterPath, QColor, QStyleOption)
22-
from .qt.QtCore import Qt, QRect, QPoint, QT_VERSION
22+
from .qt.QtCore import Qt, QRect, QPoint, QT_VERSION, QRectF
2323

2424
QWIDGETSIZE_MAX = (1<<24)-1
2525

@@ -410,7 +410,7 @@ def drawBackground(self, painter, rect, widget):
410410
if widget.testAttribute(Qt.WA_StyledBackground):
411411
opt = QStyleOption()
412412
opt.initFrom(widget)
413-
opt.rect = rect.toAlignedRect()
413+
opt.rect = QRectF(rect).toAlignedRect()
414414
widget.style().drawPrimitive(QStyle.PE_Widget, opt,
415415
painter, widget)
416416
else:

0 commit comments

Comments
 (0)