Results 1 to 3 of 3

Thread: Tracking from one plot to another plot

  1. #1
    Join Date
    Apr 2013
    Posts
    63
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Tracking from one plot to another plot

    I have two QWT plots. Both has same X axis but with different curves with different data. When I move my mouse in one plot, I was able to track the mouse location using Zoomer. When I move my mouse in first plot, I want a vertical line in second plot corresponding to the X Co-ordinate of mouse location in the first plot. What is the best way to achieve this? Probably I can use a marker, but how/when do I update its values? I searched for signals in plot, but could not found anything useful. Please help.

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

    Default Re: Tracking from one plot to another plot

    A zoomer is for zooming, what you want to have is its baseclass: QwtPlotPicker. See the curvetracker example as inspiration.

    For the first plot you probably want to have a picker without rubberband and a QwtPickerTrackerMachine.
    For the second plot you could also use a picker, but in the end it might be easier to derive from QwtWidgetOverlay drawing a vertical line in drawOverlay().

    Uwe

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

    mqt (19th June 2013)

  4. #3
    Join Date
    Apr 2013
    Posts
    63
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Tracking from one plot to another plot

    Uwe,
    I was able to solve it by using QwtPlotPicker moved() signal. But for vertical line I have used a marker in second plot, who's value dynamically changed in a slot. This looks simple and serves the purpose.
    One more thing I want to know. The moved() signal is emitted only when the mouse is dragged. Is there a way to emit signal for moving the mouse without dragging?
    Similarly, for zoomer, it always uses click and click as box corners. I was able to change which mouse button to use but not able to make drag and drop locations as box corners.

Similar Threads

  1. Put plot axis out of the plot
    By KosyakOFF in forum Qwt
    Replies: 7
    Last Post: 21st June 2013, 13:36
  2. Replies: 3
    Last Post: 12th April 2013, 06:18
  3. Replies: 1
    Last Post: 17th April 2012, 10:10
  4. Replies: 0
    Last Post: 16th December 2011, 18:10
  5. Replies: 7
    Last Post: 22nd September 2008, 22:05

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.