Results 1 to 5 of 5

Thread: Drawing Rect on QwtPlot

  1. #1
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Drawing Rect on QwtPlot

    I am planning to overlay some boxes (rects) on top of my spectrogram but i am not sure how to go about this.

    background:

    these boxes can be up to millions ,information is from a database so i am expecting lots.

    I dont think all of them will be shown in one time, its just too much information to handle for the user - say if valid x is from 0 to 1000000 , i will only give my user maximum of 200 units x at a time , and they can scroll left and right to navigate from 0 - 1000000. but still i should be prepared to handle more than 100 boxes.

    My plans:

    a) I would sublass QwtPlotItem which will represent a single rect.plot will have lots of items to draw i am not sure if this is efficient;
    b) I would give a plotCurve a Rect Data (4 points) which represent a rect. This is worse than option a i think.

    your thoughts? your opinion is highly appreciated

    baray98

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

    Default Re: Drawing Rect on QwtPlot

    With the version of SVN trunk you could use a QwtPlotShapeItem - with Qwt 6.0 you can use the RectItem from the navigation example.
    Using curves for displaying rectangles is no good idea - as long as its size depends on plot coordinates ( otherwise it could be a curve symbol ).

    Using one item for each rectangle of course has a lot overhead compared with an implementation where you have one item for all rectangles. But this depends on details I don't know.

    Uwe

  3. #3
    Join Date
    Mar 2009
    Posts
    14
    Thanked 2 Times in 2 Posts

    Default Re: Drawing Rect on QwtPlot

    I am just getting started with Qwt. In case it may be relevant to your application, the Qwt example cpuplot draws a pie chart overlay on the graph.

    Or maybe a hover over and display tool-tip approach might be less cluttered? The user could hover over a peak and tool tip could display relevant nformation?

    -Ed
    Last edited by esutton; 23rd October 2012 at 16:52.

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

    Default Re: Drawing Rect on QwtPlot

    Quote Originally Posted by esutton View Post
    The user could hover over a peak and tool tip could display relevant information?
    This is usually done with a QwtPlotPicker - you find many threads about this topic in this forum. Note that QwtText can have a background with a frame ( = rectangle ) around the tracker text.

    In opposite to a tracker you can use a marker if you want to have something persistant ( f.e when it should be part of a PDF you want to generate ).

    Uwe

  5. #5
    Join Date
    Mar 2009
    Posts
    14
    Thanked 2 Times in 2 Posts

    Default Re: Drawing Rect on QwtPlot

    Quote Originally Posted by Uwe View Post
    This is usually done with a QwtPlotPicker
    Uwe
    Good tip thank you!

  6. The following user says thank you to esutton for this useful post:

    maverick (31st May 2013)

Similar Threads

  1. Replies: 0
    Last Post: 1st November 2010, 08:22
  2. Get rect tab on object QTabWidget
    By votinh in forum Qt Programming
    Replies: 1
    Last Post: 3rd June 2010, 11:21
  3. Replies: 6
    Last Post: 14th May 2009, 12:02
  4. Focus rect not drawing
    By draftpunk in forum Qt Programming
    Replies: 3
    Last Post: 11th November 2008, 15:21
  5. QListWidgetItem Text Rect
    By js67257 in forum Qt Programming
    Replies: 2
    Last Post: 22nd August 2006, 12:02

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.