In an Qt application I am extending, I display a list of thumbnails, selecting a thumbnail opens a plot window with the source of the thumbnail. I a newbie at all this but did manage to write a simple widget which embedded a matplotlib FigureCanvas. It appears that I also need to code the zoom to rectangle and save view functionality I like in the default plot window. I have no idea if this is easy or hard, so thought it may just be easier be able to reuse the default plotting window. When I show() a plot form within a Qt application I get the following message printed on the console:
QCoreApplication::exec: The event loop is already running
I think I understand the error, obviously the application I calling form control the even loop. I suppose I need to somehow supply a parent window to pylab plot or the show() function. Is there a way to create a plot and show so as not to use the main loop?
[...] When I show() a plot form within a Qt application I get the
following message printed on the console:
QCoreApplication::exec: The event loop is already running
I think I understand the error, obviously the application I calling form
control the even loop. I suppose I need to somehow supply a parent
window to pylab plot or the show() function. Is there a way to create
a plot and show so as not to use the main loop?
Do not use show() in a GUI application.
If you have a FigureCanvas instance embedded in your app, call its
draw() method.
If you use pyplot.figure() to create a matplotlib window from your
app, call pyplot.draw().