From 180482a1cdd0f1aac0b4ca348db700e703d44d69 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 20 Dec 2024 15:35:33 -0500 Subject: [PATCH] Backport PR #29355: Add QtCore.Slot() decorations to FigureCanvasQT --- lib/matplotlib/backends/backend_qt.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/backends/backend_qt.py b/lib/matplotlib/backends/backend_qt.py index 432bbb1ffdb6..5cde4866cad7 100644 --- a/lib/matplotlib/backends/backend_qt.py +++ b/lib/matplotlib/backends/backend_qt.py @@ -239,6 +239,7 @@ def __init__(self, figure=None): palette = QtGui.QPalette(QtGui.QColor("white")) self.setPalette(palette) + @QtCore.Slot() def _update_pixel_ratio(self): if self._set_device_pixel_ratio( self.devicePixelRatioF() or 1): # rarely, devicePixelRatioF=0 @@ -248,6 +249,7 @@ def _update_pixel_ratio(self): event = QtGui.QResizeEvent(self.size(), self.size()) self.resizeEvent(event) + @QtCore.Slot(QtGui.QScreen) def _update_screen(self, screen): # Handler for changes to a window's attached screen. self._update_pixel_ratio()