Merge pull request #19123 from QuLogic/qt-screen-change · matplotlib/matplotlib@081efb4 · GitHub
Skip to content

Commit 081efb4

Browse files
authored
Merge pull request #19123 from QuLogic/qt-screen-change
Use Qt events to refresh pixel ratio.
2 parents ecba1d2 + 7bc17ad commit 081efb4

4 files changed

Lines changed: 39 additions & 56 deletions

File tree

lib/matplotlib/backends/backend_qt5.py

Lines changed: 19 additions & 18 deletions

lib/matplotlib/backends/backend_qt5agg.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ def paintEvent(self, event):
2727
In Qt, all drawing should be done inside of here when a widget is
2828
shown onscreen.
2929
"""
30-
if self._update_dpi():
31-
# The dpi update triggered its own paintEvent.
32-
return
3330
self._draw_idle() # Only does something if a draw is pending.
3431

3532
# If the canvas does not have a renderer, then give up and wait for

lib/matplotlib/backends/backend_qt5cairo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ def draw(self):
1717
super().draw()
1818

1919
def paintEvent(self, event):
20-
self._update_dpi()
2120
dpi_ratio = self._dpi_ratio
2221
width = int(dpi_ratio * self.width())
2322
height = int(dpi_ratio * self.height())

lib/matplotlib/tests/test_backend_qt.py

Lines changed: 20 additions & 34 deletions

0 commit comments

Comments
 (0)