how can i use matplotlib by PyhtonQt in a qt/C++ application? Thanks
mainwindow.cpp
Well, first, did you install matplotlib into your embedded Python interpreter? Because it seems like you didn't. Perhaps you just need to extend the PYTHON_PATH for matplotlib to be found? This can be done with PythonQt::self()->addSysPath().
Second: Matplotlib is not prepared to work with PythonQt. In MeVisLab we patch matplotlib to make it work with PythonQt. These patches can be found here.
Third: To use matplotlib in an already running event loop (like you seem to do), you need additional support. In MeVisLab we currently use qasync, which we also patched to work with PythonQt. The patches can be found here. qasync is then initialized with the following code:
import qasync
import asyncio
qtLoop = qasync.QEventLoop()
asyncio.set_event_loop(qtLoop)
# this is a 'trick', we start the event loop BUT leave it to MeVisLab to call QApplication.exec()
qtLoop.run_forever_start()