Results 1 to 9 of 9

Thread: Qwt Bode example prints always the curves (and its legend lines) in black

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2010
    Posts
    64
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    18

    Default Qwt Bode example prints always the curves (and its legend lines) in black

    Hey guys,

    I'm triying to print a QwtPlot and I cannot print its curves in color. I looked at the Bode example, and in the example is the same. You just open the example, go to print and then print it in yout printer (in color) or print in a pdf file with a pdf printer. It is always the same, the curves, amplitude and phase are both black.

    There is a bug in the example?, there is a bug in the QwtPlot module? Has anyone else noticed that?

    I post here the printing code from the Bode example

    Qt Code:
    1. #if 1
    2. QPrinter printer;
    3. #else
    4. QPrinter printer(QPrinter::HighResolution);
    5. #if QT_VERSION < 0x040000
    6. printer.setOutputToFile(true);
    7. printer.setOutputFileName("/tmp/bode.ps");
    8. printer.setColorMode(QPrinter::Color);
    9. #else
    10. printer.setOutputFileName("/tmp/bode.pdf");
    11. #endif
    12. #endif
    13.  
    14. QString docName = d_plot->title().text();
    15. if ( !docName.isEmpty() )
    16. {
    17. docName.replace (QRegExp (QString::fromLatin1 ("\n")), tr (" -- "));
    18. printer.setDocName (docName);
    19. }
    20.  
    21. printer.setCreator("Bode example");
    22. printer.setOrientation(QPrinter::Landscape);
    23.  
    24. #if QT_VERSION >= 0x040000
    25. QPrintDialog dialog(&printer);
    26. if ( dialog.exec() )
    27. {
    28. #else
    29. if (printer.setup())
    30. {
    31. #endif
    32. if ( printer.colorMode() == QPrinter::GrayScale )
    33. {
    34. int options = QwtPlotPrintFilter::PrintAll;
    35. options &= ~QwtPlotPrintFilter::PrintBackground;
    36. options |= QwtPlotPrintFilter::PrintFrameWithScales;
    37. filter.setOptions(options);
    38. }
    39. d_plot->print(printer, filter);
    40. }
    To copy to clipboard, switch view to plain text mode 

    Thanks!
    Last edited by locke; 12th August 2010 at 16:11.

Similar Threads

  1. Replies: 1
    Last Post: 12th August 2010, 15:19
  2. Replies: 3
    Last Post: 20th April 2010, 16:49
  3. Replies: 1
    Last Post: 19th March 2010, 13:36
  4. QGLWidget renders black
    By jonasbalmer in forum General Programming
    Replies: 2
    Last Post: 24th January 2010, 15:32
  5. Drag and drop and black background
    By zerobala in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2008, 20:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.