Results 1 to 3 of 3

Thread: Snapping mouse cursor to curves to show tracker text, click to make it stay

  1. #1
    Join Date
    Sep 2010
    Posts
    43
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Snapping mouse cursor to curves to show tracker text, click to make it stay

    Hi,

    Thanks a lot for the great Qwt!

    Is it possible to do something like Qt Charts' "callout" example in Qwt (or something similar)?

    This is my task:

    1. The mouse cursor's tracker (showing X and Y coordinates) should "snap" to a curve if it's close enough. I'm not sure yet whether it should be the actual curve points or the interpolated curve. I guess just the curve points would be fine.

    2. The tracker texts (showing X and Y coordinates) should stay there (maybe as a marker item) when the user clicks (actually, control-clicks) that point. Multiple such markers should be possible. Control-clicking them again should remove them (though this could be done though a context menu to remove all such markers).

    Any pointers, examples, or even suggestions to forget about this are welcome!

    Thanks a lot!
    Alexander

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

    Default Re: Snapping mouse cursor to curves to show tracker text, click to make it stay

    The mouse cursor's tracker (showing X and Y coordinates) should "snap" to a curve if it's close enough.
    This is usually done with a QwtPlotPicker - maybe have a look at the curveTracker example for inspiration.

    The tracker texts (showing X and Y coordinates) should stay there (maybe as a marker item) when the user clicks (actually, control-clicks) that point.
    If you assign a QwtPickerClickPointMachine to your picker you get signals in plot coordinates for each click. Then all you have to do is to insert/remove a QwtPlotMarker.

    HTH,
    Uwe

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

    alex_sh (13th May 2019)

  4. #3
    Join Date
    Sep 2010
    Posts
    43
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Snapping mouse cursor to curves to show tracker text, click to make it stay

    Thank you very much, Uwe.
    I'll follow your suggestions.

    Thanks!
    Alexander

Similar Threads

  1. Replies: 1
    Last Post: 19th April 2012, 10:49
  2. QGraphicsView - show mouse cursor position in status bar
    By mwgobetti in forum Qt Programming
    Replies: 5
    Last Post: 19th November 2011, 19:34
  3. Replies: 5
    Last Post: 15th January 2011, 17:50
  4. QGraphicsTextItem: How to show the text cursor?
    By breezeight in forum Qt Programming
    Replies: 1
    Last Post: 17th November 2009, 17:44
  5. Replies: 1
    Last Post: 10th July 2009, 10: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.