Results 1 to 2 of 2

Thread: QwtPlot cursor (like Audacity)

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

    Default QwtPlot cursor (like Audacity)

    Hi all,

    I need cursor conception on a QwtPlot. The cursor is not a mouse cursor, but a part of plotted area across one axis. Looks like this PositionCursor.png.

    The cursor consists from marker on a scale (green triangle) and vertical rectangle on plotting area.

    For instance, plotting data have ranve [0, 10] on X-axis, and the cursor has position 1 and width 2, i.e. [1,2). There will be vertical rectangle orthogonal X-axis and marker (green triangle) on X-axis scale located at 1.

    How is the best way to implement this?

    Thanks.

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

    Default Re: QwtPlot cursor (like Audacity)

    Drawing the marker on the scale could be done by deriving from QwtScaleDraw.

    For the rectangle over the plot area you could implement it as QwtWidgetOverlay or as QwtPlotItem - depends on the use case of your application. Using an overlay is often the better solution for interactive elements like cursors or rubber bands. F.e QwtPlotPicker or QwtPlotZoomer use a widget overlay.

    Uwe

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

    Alekon (7th November 2014)

Similar Threads

  1. QwtPlot cursor
    By hamid ghous in forum Qwt
    Replies: 6
    Last Post: 3rd March 2016, 07:30
  2. Replies: 0
    Last Post: 29th October 2012, 12:23
  3. Replies: 4
    Last Post: 26th November 2010, 11:55
  4. Replies: 2
    Last Post: 2nd October 2009, 16:32
  5. How to synchronize text cursor and cursor in QTextEdit
    By kennyxing in forum Qt Programming
    Replies: 6
    Last Post: 18th February 2007, 10:14

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.