Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1686a5a

Browse files
authored
Merge pull request #17600 from tacaswell/mnt_more_qt515_fixes
FIX: work with PyQt 5.15
2 parents c3b37ca + 3eca034 commit 1686a5a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/backends/backend_qt5.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@ def start_event_loop(self, timeout=0):
427427
raise RuntimeError("Event loop already running")
428428
self._event_loop = event_loop = QtCore.QEventLoop()
429429
if timeout > 0:
430-
timer = QtCore.QTimer.singleShot(timeout * 1000, event_loop.quit)
430+
timer = QtCore.QTimer.singleShot(int(timeout * 1000),
431+
event_loop.quit)
431432
event_loop.exec_()
432433

433434
def stop_event_loop(self, event=None):
@@ -462,7 +463,7 @@ def blit(self, bbox=None):
462463
if bbox is None and self.figure:
463464
bbox = self.figure.bbox # Blit the entire canvas if bbox is None.
464465
# repaint uses logical pixels, not physical pixels like the renderer.
465-
l, b, w, h = [pt / self._dpi_ratio for pt in bbox.bounds]
466+
l, b, w, h = [int(pt / self._dpi_ratio) for pt in bbox.bounds]
466467
t = b + h
467468
self.repaint(l, self.rect().height() - t, w, h)
468469

0 commit comments

Comments
 (0)