Skip to content

Commit

Permalink
Backport PR matplotlib#29355: Add QtCore.Slot() decorations to Figure…
Browse files Browse the repository at this point in the history
…CanvasQT
  • Loading branch information
tacaswell authored and meeseeksmachine committed Dec 20, 2024
1 parent 6bb2963 commit 180482a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/matplotlib/backends/backend_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit 180482a

Please sign in to comment.