8000 FIX: qt recursive draw by tacaswell · Pull Request #9199 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

FIX: qt recursive draw #9199

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
merged 5 commits into from
Sep 26, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
FIX: qt recursive draw
 - put draw_idle in the base canvas resize event
 - re-order our resize handling and Qt's resize handling (let Qt go
   first)
 - do not call processEvents from inside of the paint event (this
   maybe the critical fix)
  • Loading branch information
tacaswell committed Sep 18, 2017
commit 7ff959cc1acc812ae5d951b6281aa598c6f98999
1 change: 1 addition & 0 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,7 @@ def resize_event(self):
s = 'resize_event'
event = ResizeEvent(s, self)
self.callbacks.process(s, event)
self.draw_idle()

def close_event(self, guiEvent=None):
"""Pass a `CloseEvent` to all functions connected to ``close_event``.
Expand Down
EEA2
5 changes: 3 additions & 2 deletions lib/matplotlib/backends/backend_qt5.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,10 @@ def resizeEvent(self, event):
winch = w / dpival
hinch = h / dpival
self.figure.set_size_inches(winch, hinch, forward=False)
FigureCanvasBase.resize_event(self)
self.draw_idle()
# pass back into Qt to let it finish
QtWidgets.QWidget.resizeEvent(self, event)
# emit our resize events
FigureCanvasBase.resize_event(self)

def sizeHint(self):
w, h = self.get_width_height()
Expand Down
1 change: 0 additions & 1 deletion lib/matplotlib/backends/backend_qt5agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def paintEvent(self, e):
# since the latter doesn't guarantee that the event will be emitted
# straight away, and this causes visual delays in the changes.
self.resizeEvent(event)
QtWidgets.QApplication.instance().processEvents()
# resizeEvent triggers a paintEvent itself, so we exit this one.
return

Expand Down
0