Results 1 to 3 of 3

Thread: Can't see QwtCurve with aliceBlue color QPen

  1. #1
    Join Date
    Dec 2010
    Location
    Israel
    Posts
    90
    Thanks
    59
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Can't see QwtCurve with aliceBlue color QPen

    I'm using a QwtPlot based on one of the samples, with multiple curves.

    When my QwtCurve is configured with a aliceblue color pen, I don't see the curve (this does not reproduce with other colors).

    Would be hard to put in all the code that draws the points but here is the color related part:

    Relevant header:
    Qt Code:
    1. //! Collection of all curves in plot
    2. QMap<QString, QwtPlotCurve*> mCurves;
    To copy to clipboard, switch view to plain text mode 

    Code in constructor:
    Qt Code:
    1. setAutoReplot(false);
    2.  
    3. //! No caching
    4. canvas()->setPaintAttribute(QwtPlotCanvas::PaintCached, false);
    5.  
    6. #if defined(Q_WS_X11)
    7. // Even if not recommended by TrollTech, Qt::WA_PaintOutsidePaintEvent
    8. // works on X11. This has a nice effect on the performance.
    9.  
    10. canvas()->setAttribute(Qt::WA_PaintOutsidePaintEvent, true);
    11. canvas()->setAttribute(Qt::WA_PaintOnScreen, true);
    12. #endif
    13.  
    14. plotLayout()->setAlignCanvasToScales(true);
    15. QwtPlotGrid *grid = new QwtPlotGrid();
    16. grid->setPen(QPen(Qt::gray, 0.0, Qt::DotLine));
    17. grid->enableX(true);
    18. grid->enableXMin(true);
    19. grid->enableY(true);
    20. grid->enableYMin(false);
    21. grid->attach(this);
    22.  
    23. for (int i = 0; i < objectsToPlot.count(); i++)
    24. {
    25. QwtPlotCurve *currCurve = new QwtPlotCurve(objectsToPlot.at(i).combinedIndex);
    26. currCurve->setStyle(QwtPlotCurve::Lines);
    27. currCurve->setPen(QPen(objectsToPlot.at(i).color)); // Here: color is aliceBlue
    28. currCurve->setRenderHint(QwtPlotItem::RenderAntialiased, true);
    29. currCurve->setPaintAttribute(QwtPlotCurve::ClipPolygons, false);
    30. currCurve->setZ(i);
    31. currCurve->setData(new QwtPointSeriesData());
    32. currCurve->attach(this);
    33.  
    34. mCurves.insert(objectsToPlot.at(i).combinedIndex, currCurve);
    35. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Can't see QwtCurve with aliceBlue color QPen

    aliceblue is a very bright blue. on a white background it might be almost invisible, have you tried with a dark background? can you see aliceblue in an other context (painting tool,...)? I had this once with a bright yellow which made me crazy until I found out it was the brightness of my monitor that made the color not visible...

  3. The following user says thank you to FelixB for this useful post:

    frankiefrank (5th September 2011)

  4. #3
    Join Date
    Dec 2010
    Location
    Israel
    Posts
    90
    Thanks
    59
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Can't see QwtCurve with aliceBlue color QPen

    Thanks, when I changed the canvas background to Qt::black I saw it fine

Similar Threads

  1. qwtcurve vector
    By 21did21 in forum Qwt
    Replies: 4
    Last Post: 18th June 2011, 01:07
  2. QwtCurve faster repaint
    By baray98 in forum Qwt
    Replies: 2
    Last Post: 21st May 2010, 07:43
  3. Diff between QBrush and QPen
    By wagmare in forum Qt Programming
    Replies: 5
    Last Post: 16th February 2009, 15:47
  4. QPen color shift
    By Alberto in forum Qt Programming
    Replies: 0
    Last Post: 22nd October 2008, 12:35
  5. Problems with QPen
    By prosass in forum Newbie
    Replies: 3
    Last Post: 13th March 2007, 16:54

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.