Skip to content

Commit 7821fb8

Browse files
committed
Workaround for PySide6 bug on Linux in QwtScaleWidget paintEvent
1 parent e40d548 commit 7821fb8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

qwt/scale_widget.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import math
1717

18-
from qtpy.QtCore import QRectF, QSize, Qt, Signal
18+
from qtpy.QtCore import QRect, QRectF, QSize, Qt, Signal
1919
from qtpy.QtGui import QPainter, QPalette
2020
from qtpy.QtWidgets import QSizePolicy, QStyle, QStyleOption, QWidget
2121

@@ -401,6 +401,10 @@ def spacing(self):
401401
return self.__data.spacing
402402

403403
def paintEvent(self, event):
404+
# Workaround for a bug with PySide6 on Linux:
405+
if isinstance(event, QRect):
406+
return
407+
404408
painter = QPainter(self)
405409
painter.setClipRegion(event.region())
406410
opt = QStyleOption()

0 commit comments

Comments
 (0)