core dumped using NavigationToolbar with PySide

Hello,

I think I found a bug using NavigationToolbar with Pyside.

******** my system ********

OS: ubuntu 12.04

`uname -a`: Linux parcouss-M720T-M730T 3.2.0-26-generic-pae #41-Ubuntu SMP Thu Jun 14 16:45:14 UTC 2012 i686 i686 i386 GNU/Linux

matplotlib version: 1.1.1rc (ubuntu distribution package)

PySide version: 1.1.0 (ubuntu distribution package)

******** how to reproduce the bug ********

Here is a simple script to get the core dumped crash:

import matplotlib

matplotlib.use('Qt4Agg')
matplotlib.rcParams['backend.qt4']='PySide'

from matplotlib.figure import Figure
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar

from PySide.QtGui import QWidget, QVBoxLayout , QApplication
import sys

class Main(QWidget):
    def __init__(self):
        QWidget.__init__(self)
        self.setLayout(QVBoxLayout())
        self.canvas = FigureCanvas(Figure())
        self.toolbar = NavigationToolbar(self.canvas, self)
        self.layout().addWidget(self.toolbar)
        self.layout().addWidget(self.canvas)

if __name__ == '__main__':
    app = QApplication(sys.argv)
    m = Main()
    m.show()
    app.exec_()

It may be relative to a mousemoveent, as it does not
crash until I move the mouse on the window.

Julien Pages

BTW: thanks to the really great matplotlib framework :slight_smile:

Hello again,

I found that the crash is a PySide 1.1.0 bug: https://groups.google.com/forum/?fromgroups#!topic/pyside/dNSzyupTFMU

It seems to be fixed in newer versions of PySide. Until I get it packaged on my ubuntu I have to change my code like this:

from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as _NavigationToolbar
from matplotlib.backends.backend_qt4 import cursord

from PySide.QtGui import QWidget, QVBoxLayout, QApplication, QCursor

class NavigationToolbar(_NavigationToolbar):
    def set_cursor( self, cursor ):
        QApplication.restoreOverrideCursor()
        qcursor = QCursor()
        qcursor.setShape(cursord[cursor])
        QApplication.setOverrideCursor( qcursor )

----- Mail original -----

···

De: "julien parc" <julien.parc@...185...>
À: matplotlib-users@lists.sourceforge.net
Envoyé: Dimanche 15 Juillet 2012 12:07:33
Objet: [Matplotlib-users] core dumped using NavigationToolbar with PySide

Hello,

I think I found a bug using NavigationToolbar with Pyside.

******** my system ********

OS: ubuntu 12.04

`uname -a`: Linux parcouss-M720T-M730T 3.2.0-26-generic-pae #41-Ubuntu SMP Thu Jun 14 16:45:14 UTC 2012 i686 i686 i386 GNU/Linux

matplotlib version: 1.1.1rc (ubuntu distribution package)

PySide version: 1.1.0 (ubuntu distribution package)

******** how to reproduce the bug ********

Here is a simple script to get the core dumped crash:

import matplotlib

matplotlib.use('Qt4Agg')
matplotlib.rcParams['backend.qt4']='PySide'

from matplotlib.figure import Figure
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar

from PySide.QtGui import QWidget, QVBoxLayout , QApplication
import sys

class Main(QWidget):
    def __init__(self):
        QWidget.__init__(self)
        self.setLayout(QVBoxLayout())
        self.canvas = FigureCanvas(Figure())
        self.toolbar = NavigationToolbar(self.canvas, self)
        self.layout().addWidget(self.toolbar)
        self.layout().addWidget(self.canvas)

if __name__ == '__main__':
    app = QApplication(sys.argv)
    m = Main()
    m.show()
    app.exec_()

It may be relative to a mousemoveent, as it does not
crash until I move the mouse on the window.

Julien Pages

BTW: thanks to the really great matplotlib framework :slight_smile:

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users