Results 1 to 15 of 15

Thread: QwtPlotPicker::trackertex for labels in qwtplot problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2009
    Posts
    27
    Qt products
    Qt4
    Platforms
    MacOS X
    Thanks
    3

    Default Re: QwtPlotPicker::trackertex for labels in qwtplot problem

    Hi Uwe,

    I just figured out the problem was for loop so I just removed the loop out of the program and used distance function of vectors to get the index of the value and now its showing me the labels (problem solved)...but as I am showing label on the basis of pixel coordinates so its really hard to see the label cursor has to be on exact pixel coordinates. I am using Xcross as symbol. Is there any way that I can see label whenever cursor comes to the symbol.
    Also how can I perform zooming with pixel coordinates?

    I really appreciate your help.

    Cheers,

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

    Default Re: QwtPlotPicker::trackertex for labels in qwtplot problem

    but as I am showing label on the basis of pixel coordinates so its really hard to see the label cursor has to be on exact pixel coordinates.
    ?????

    I am using Xcross as symbol. Is there any way that I can see label whenever cursor comes to the symbol.
    Setting EPS to 0.5 + symbol.size and you will have matches for the bounding rectangle of the cross. If you need exact compares with the shape of a symbol you could paint the symbol on a bitmap translate its center to the mapped curve point and compare the mouse position with the corresponding bit.

    Also how can I perform zooming with pixel coordinates?
    The only thing that need to be done in pixel coordinates is the point matching algo. I don't see a reason to do anything else in pixel coordinates.

    Your code should be like this:

    Qt Code:
    1. virtual QwtText YourPicker::trackerText(const QPoint &pos) const
    2. {
    3. QwtText text;
    4. if ( isNearToACurvePoint(pos) );
    5. text = QwtPlotPicker::trackerText(pos);
    6.  
    7. return text;
    8. }
    To copy to clipboard, switch view to plain text mode 
    Uwe

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

    hamid ghous (17th April 2010)

  4. #3
    Join Date
    Jun 2009
    Posts
    27
    Qt products
    Qt4
    Platforms
    MacOS X
    Thanks
    3

    Default Re: QwtPlotPicker::trackertex for labels in qwtplot problem

    Thanks Uwe for your help..

  5. #4
    Join Date
    Jun 2009
    Posts
    27
    Qt products
    Qt4
    Platforms
    MacOS X
    Thanks
    3

    Default Re: QwtPlotPicker::trackertex for labels in qwtplot problem

    Hi Uwe,

    Here is what I was trying to say about zooming; I was performing simple zooming by using following code:

    I am not after complicated zooming just the simple one.
    Qt Code:
    1. QwtPlotZoomer *zoomer;
    2. zoomer= new QwtPlotZoomer(QwtPlot::xBottom,QwtPlot::yRight,myPlot->canvas());
    3. zoomer->setTrackerMode(QwtPicker::AlwaysOff);
    To copy to clipboard, switch view to plain text mode 

    But Now when I zoom in,it doesn't show me the label on the point. Any idea how can I do it...

    Regards,

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

    Default Re: QwtPlotPicker::trackertex for labels in qwtplot problem

    Read this thread and do the same for your zoomer ( QwtPlotZoomer is derived from QwtPlotPicker ).

    Uwe

  7. #6
    Join Date
    Jun 2009
    Posts
    27
    Qt products
    Qt4
    Platforms
    MacOS X
    Thanks
    3

    Default Re: QwtPlotPicker::trackertex for labels in qwtplot problem

    Where is this thread?

  8. #7
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: QwtPlotPicker::trackertex for labels in qwtplot problem

    It starts at the beginning of this page and ends at the bottom - are you serious ?

    Uwe

  9. #8
    Join Date
    Jun 2009
    Posts
    27
    Qt products
    Qt4
    Platforms
    MacOS X
    Thanks
    3

    Default Re: QwtPlotPicker::trackertex for labels in qwtplot problem

    Oh sorry I thought may be you were saying the thread title is ( QwtPlotZoomer is derived from QwtPlotPicker )

Similar Threads

  1. Replies: 1
    Last Post: 16th March 2010, 15:23
  2. QWTPLOT problem
    By umulingu in forum Qwt
    Replies: 5
    Last Post: 25th August 2009, 16:34
  3. QwtPlotPicker questions
    By ttvo in forum Qwt
    Replies: 7
    Last Post: 28th February 2009, 09:44
  4. Problem regarding QWTPLOT
    By sudheer168 in forum Qwt
    Replies: 1
    Last Post: 6th January 2009, 14:18
  5. Problem with QwtPlot
    By sudheer168 in forum Qwt
    Replies: 1
    Last Post: 11th September 2008, 09:04

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.