Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

added QtGui.QMainWindow.closeEvent() to make sure the close event #1678

Merged
merged 2 commits into from

2 participants

@tacaswell
Owner

cascades closeEvents up properly.

issue #1676

I am not sure if there is a testable issue that shows up with out this patch, but this my understanding of good practice when over-riding functions in sub-classed QT classes.

I will look for any issues that show up without this.

@dmcdougall
Collaborator

Hmmm. On master my test_bbox_inches tests pass, but with your patch one of them fails. This is locally. Strange.

Edit: And it's the same diff as we remarked here

lib/matplotlib/backends/backend_qt4.py
@@ -370,6 +370,7 @@ def idle_draw(*args):
class MainWindow(QtGui.QMainWindow):
def closeEvent(self, event):
self.emit(QtCore.SIGNAL('closing()'))
+ QtGui.QMainWindow.closeEvent(self,event)
@dmcdougall Collaborator

For PEP8 compliancy, can you add a space after the comma?

@tacaswell Owner

Sorry about that. That habit has not fully taken yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@tacaswell
Owner

re-based to master (to avoid

On master, I get failures on test_arraw_ptachs.test_fancyarrow.test (1 error, 2 failures) which looks like issues with size of the output images.

I get the exact same failures with this patch.

ERROR: matplotlib.tests.test_arrow_patches.test_fancyarrow.test

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/tcaswell/local_installs/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 39, in failer
    result = f(*args, **kwargs)
  File "/home/tcaswell/local_installs/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 148, in do_test
    self._tol, in_decorator=True)
  File "/home/tcaswell/local_installs/lib/python2.7/site-packages/matplotlib/testing/compare.py", line 340, in compare_images
    np.asarray(expectedImage, dtype=np.int))
ValueError: operands could not be broadcast together with shapes (450,800,4) (600,800,4) 
Thomas A Caswell PEP8 fix 0729489
@dmcdougall
Collaborator

@tacaswell Yes, I have reported the issue in #1681, and it's nothing to do with this patch.

I'll merge this now. Thanks.

@dmcdougall dmcdougall merged commit 999f1b2 into matplotlib:master

1 check failed

Details default The Travis build failed
@tacaswell tacaswell deleted the tacaswell:qt4_closeevent branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 17, 2013
  1. @tacaswell

    added QtGui.QMainWindow.closeEvent() to make sure the close event

    Thomas A Caswell authored tacaswell committed
    cascades up properly.
    
    issue #1676
Commits on Jan 18, 2013
  1. PEP8 fix

    Thomas A Caswell authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/matplotlib/backends/backend_qt4.py
View
1  lib/matplotlib/backends/backend_qt4.py
@@ -370,6 +370,7 @@ def idle_draw(*args):
class MainWindow(QtGui.QMainWindow):
def closeEvent(self, event):
self.emit(QtCore.SIGNAL('closing()'))
+ QtGui.QMainWindow.closeEvent(self, event)
class FigureManagerQT( FigureManagerBase ):
"""
Something went wrong with that request. Please try again.