From: Darren D. <dd...@co...> - 2006-08-16 12:14:12
|
On Wednesday 16 August 2006 04:54, Samuel GARCIA wrote: > I still have a problem. This is my code : > > import sys > > from PyQt4.QtCore import * > from PyQt4.QtGui import * > > from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as > FigureCanvas > from matplotlib.figure import Figure > > #-------------------------------------------------------------------------- >---- class MyWidget(QWidget): > def __init__(self, parent=None): > QWidget.__init__(self, parent) > self.menuBar = QMenuBar() > self.fileMenu = QMenu(self.tr("&File"), self) > self.menuBar.addMenu(self.fileMenu) > > mainLayout = QVBoxLayout() > mainLayout.setMenuBar(self.menuBar) > > self.setLayout(mainLayout) > > #-------------------------------------------------------------------------- >---- if __name__ == "__main__": > app = QApplication(sys.argv) > dialog = MyWidget() > dialog.show() > sys.exit(app.exec_()) > > and it does not works because the main window is blocking. > But when I comment this line : > #from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as > FigureCanvas > it works ! > What am I doing wrong ? You may not be doing anything wrong. The qt4 backend is new and hasn't seen much use. I think you are the first to try to embed in your own qt4 application. If you feel up to it, maybe you could try to track down the problem. Darren |