Has anyone tried doing anything with Qwt and the offscreen rendering part of Qt 5?

It seems very close to being able to make a PNG/PDF without an X connection, but isn't quite there. If this could work, Qwt could be used for server side programing from a webpage!

The problem I am seeing are the fonts, legends, scales, etc. are not being rendered.

I tried with one of the example programs and I see the same thing! I've tried with minimal and offscreen, but no difference.

Any ideas?

Thanks,
Joey

Here's a short diff to duplicate the problem on the friedberg example, and then you run it as "bin/friedberg -platform minimal". The resulting friedberg.png will have the right image, without the fonts.

Qt Code:
  1. Index: plot.cpp
  2. ===================================================================
  3. --- plot.cpp (revision 2458)
  4. +++ plot.cpp (working copy)
  5. @@ -205,5 +205,5 @@
  6. void Plot::exportPlot()
  7. {
  8. QwtPlotRenderer renderer;
  9. - renderer.exportTo( this, "friedberg.pdf" );
  10. + renderer.renderDocument( this, "friedberg.png", QSizeF( 300, 200 ), 85 );
  11. }
  12. Index: main.cpp
  13. ===================================================================
  14. --- main.cpp (revision 2458)
  15. +++ main.cpp (working copy)
  16. @@ -40,6 +40,10 @@
  17. d_plot->setMode( typeBox->currentIndex() );
  18. connect( typeBox, SIGNAL( currentIndexChanged( int ) ),
  19. d_plot, SLOT( setMode( int ) ) );
  20. + if (qApp->platformName () == "minimal") {
  21. + d_plot->exportPlot ();
  22. + exit (0);
  23. + }
  24. }
  25.  
  26. int main( int argc, char **argv )
To copy to clipboard, switch view to plain text mode