Skip to content

Commit 7375bfb

Browse files
committed
QwtPlainTextEngine.findAscent: fixed PySide2 compat. (asstring replacement)
1 parent e2bad35 commit 7375bfb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

qwt/text.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,10 @@ def findAscent(self, font):
297297
w = pm.width()
298298
linebytes = w * 4
299299
for row in range(img.height()):
300-
line = img.scanLine(row).asstring(linebytes)
300+
if PYSIDE2:
301+
line = bytes(img.scanLine(row))
302+
else:
303+
line = img.scanLine(row).asstring(linebytes)
301304
for col in range(w):
302305
color = struct.unpack("I", line[col * 4 : (col + 1) * 4])[0]
303306
if color != white.rgb():

0 commit comments

Comments
 (0)