Results 1 to 3 of 3

Thread: QwtPlotPicker picks points of whole canvas, but I need only the points on QwtPlotCurv

  1. #1
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default QwtPlotPicker picks points of whole canvas, but I need only the points on QwtPlotCurv

    As I'm giving the canvas of the plot, it's taking the whole canvas for mouse tracking. But how do I set it to track/show only the points of the curve?

    Qt Code:
    1. curve->setSamples(xValues, yValues, 11);
    2. curve->attach(oParamGraph);
    3.  
    4. oParamGraph->setAxisScaleDraw(QwtPlot::xBottom, new TimeScaleDraw(cpuStat.upTime()));
    5. oParamGraph->setAxisScale(QwtPlot::xBottom, 0, 165, 15);
    6. oMyPicker = new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::NoRubberBand, QwtPicker::AlwaysOn, oParamGraph[iCount]->canvas());
    To copy to clipboard, switch view to plain text mode 

    Thank you.
    Last edited by rawfool; 2nd May 2012 at 09:17.

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlotPicker picks points of whole canvas, but I need only the points on QwtPlot

    Overload QwtPolarPicker::trackerText and return QwtText(), when there is no point below a position. And no - QwtPolar doesn't offer an algo how to deceide this.

    Uwe

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

    rawfool (2nd May 2012)

  4. #3
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QwtPlotPicker picks points of whole canvas, but I need only the points on QwtPlot

    I didn't understand the following line dude.
    Quote Originally Posted by Uwe View Post
    ....., when there is no point below a position.
    Can you pls give me an example how to write condition for this.

    Thank you.

Similar Threads

  1. Replies: 6
    Last Post: 9th March 2012, 16:33
  2. Replies: 0
    Last Post: 3rd November 2011, 19:03
  3. Connecting Points using Qt
    By prajna8 in forum Newbie
    Replies: 4
    Last Post: 29th October 2010, 06:28
  4. drawing an Arc using points
    By chethana in forum Qt Programming
    Replies: 2
    Last Post: 11th July 2009, 04:59
  5. drawing points on canvas after a time period
    By quickNitin in forum Qt Programming
    Replies: 3
    Last Post: 12th May 2006, 15:12

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.