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

Skip to content

Backport PR #29355 on branch v3.10.x (Add QtCore.Slot() decorations to FigureCanvasQT) #29361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading