Skip to content
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

use QMainWindow.closeEvent for close events #1498

Merged
merged 1 commit into from Jan 16, 2013

Commits on Nov 14, 2012

  1. use QMainWindow.closeEvent for close events

    The current code uses the QWidget.destroyed signal
    to emit a close event into matplotlib. This is a very
    bad idea, as it is a heavy abuse of Qt functionality.
    
    When a main window is closed in Qt, it and its children
    are deleted if the DeleteOnClose flag is set (which we
    did set). This causes the QWidget.destroyed signal to be
    called. Setting the DeleteOnClose flag is a very bad
    idea, since objects should only be deleted by the
    garbage collector. Soon after, PyQt4 will complain
    that "the underlying C++ object has been deleted", since
    the object is alive for python but dead for C++.
    
    This patch changes the machinery to use the
    QMainWindow.closeEvent to emit a close_event, which is
    what one actually wants.
    tecki committed Nov 14, 2012
    Copy the full SHA
    e407926 View commit details
    Browse the repository at this point in the history