It doesnt work.

I added this to the .pro file;
QTPLUGIN += qjpeg qgif qmng # image formats

And in the file I included the <QtPlugin> header and after Q_IMPORT_PLUGIN(qjpeg);

But, it doest find Q_IMPORT_PLUGIN() .

I mesh2 of the qwtPlot3D exaples there are similar functions to save plots, and the example doesnt need to add any external plugin.