Results 1 to 2 of 2

Thread: Rectangular selection with "unlimited" height

  1. #1
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Rectangular selection with "unlimited" height

    Hi,

    I have a QwtPlot showing a QwtPlotCurve and I'd like to select a desired area using a rectangular selection with "unlimited" height, in order to get all the points of my curve between two x-axis coordinates and calculate average, peak, area for this selection.
    The selection should work this way: when I click in a point of my QwtPlot, a vertical "unlimited" line appears on the plot area; after this operation, moving the mouse cursor I can show a rectangle between the original position end the new one; this rectangle is automatically updated when I move the mouse cursor until I click in the desired final point, so the rectangle will be fixed on the plot area.
    I've found QwtPlotPicker class, but I was only able to draw rectangular selections with limited height and this selections are not fixed.
    Giving a look at the forum, I've understood that the best solution would be to create a custom class derived from QwtPlotItem and use mouse events, but I'll appreciate any suggestion and any example that can help me to achieve this goal.

    Thank's in advance.

    Best Regards
    Salvatore

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

    Default Re: Rectangular selection with "unlimited" height

    Your best option is to derive from QwtPlotPicker and to overload some virtual methods ( also check the base class QwtPicker for its API).

    Uwe

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

    AspiringEngineer (20th August 2012)

Similar Threads

  1. Replies: 1
    Last Post: 7th April 2010, 21:46
  2. Replies: 3
    Last Post: 15th February 2010, 17:27
  3. Replies: 3
    Last Post: 8th July 2008, 19:37
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 15:58

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
  •  
Qt is a trademark of The Qt Company.