Results 1 to 5 of 5

Thread: QwtPlotSpectroCurve: how to use triangles, squares, etc. instead of dot?

  1. #1
    Join Date
    Jun 2014
    Posts
    11
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default QwtPlotSpectroCurve: how to use triangles, squares, etc. instead of dot?

    Hi,

    this is my first message in this forum, and firstly - Uwe, great work (Qwt), many thanks!

    And now the question - it is in the thread title. For instance, I want two QwtPlotSpectroCurve on a plot: first with dots and second with triangles to distinguish them.

    Thanks

  2. #2
    Join Date
    Dec 2013
    Location
    Toronto, Canada
    Posts
    62
    Thanked 16 Times in 15 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QwtPlotSpectroCurve: how to use triangles, squares, etc. instead of dot?

    Maybe subclass QwtPlotSpectroCurve and overload drawDots()...

  3. #3
    Join Date
    Jun 2014
    Posts
    11
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QwtPlotSpectroCurve: how to use triangles, squares, etc. instead of dot?

    Thanks for your interest.

    drawPoints() can be used. After some preparation work, it calls QwtPainter::drawPoint() that may be replaced with something that draws what I need (triangle, rect, etc.).

  4. #4
    Join Date
    Dec 2013
    Location
    Toronto, Canada
    Posts
    62
    Thanked 16 Times in 15 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QwtPlotSpectroCurve: how to use triangles, squares, etc. instead of dot?

    After some preparation work, it calls QwtPainter::drawPoint() that may be replaced with something that draws what I need (triangle, rect, etc.).
    QwtPainter::drawPoint() is a wrapper for QPainter::drawPoint().
    QPainter::drawPoint() is non virtual.

  5. #5
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,225
    Thanked 854 Times in 803 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlotSpectroCurve: how to use triangles, squares, etc. instead of dot?

    QwtPlotSpectroCurve is a plot item for 3d points where the z value is mapped to color. As this is obviously not what you need consider to derive from its base class ( = displaying 3d points somehow ) instead.

    In case of deriving from QwtPlotSpectroCurve you would have to overload QwtPlotSpectroCurve::drawDots() accepting that parts of the class API are left pointless.

    Uwe

Similar Threads

  1. Using QwtPlotSpectroCurve::setSamples with large data
    By raphael.lencrerot in forum Qwt
    Replies: 2
    Last Post: 4th October 2013, 17:35
  2. Text rendered as squares
    By SeppeVanNolle in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 9th November 2011, 16:17
  3. Qwt 6.0 QwtPlotSpectroCurve dot size
    By rolvera in forum Qwt
    Replies: 1
    Last Post: 10th December 2010, 10:53
  4. variable matrix of squares,which QWidget ?
    By salmanmanekia in forum Newbie
    Replies: 5
    Last Post: 5th June 2010, 17:08
  5. Packing known number of uniform-sized squares into a known rect
    By momesana in forum General Programming
    Replies: 2
    Last Post: 17th March 2010, 16:09

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.