Results 1 to 7 of 7

Thread: QwtPicker RubberBand Performance

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2008
    Posts
    18
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QwtPicker RubberBand Performance

    Greetings,
    I have a simple question so I can clear up some things.

    I can see that in the QwtPicker there is a function called :
    virtual void drawRubberBand( QPainter * ) const;
    This function as the name suggests is responsible for drawing a rubberBand depending on the style used.

    What i wanted to do is have rubberBand that is more like the common QRubberBand while additionally it covers the whole yAxisScale to select a region for either zooming or selection for example. So initially I've overwritten the drawRubberBand function and changed the size of my QRect to use the full height of my canvas. Initially i used QwtPainter::fillRect() but then i just went with QwtPainter::drawRect() by using the proper pens and brushes.

    While this works fine and everything is good, its performance is not good as it feels slow and laggy. So instead I tested something else. If I use a QRubberBand and overwrite the mouse press, move and release event to handle the drawing properly I get a normal QRubberBand as I wanted while additionally the performance is really really good. I can then of course invTransform() my QRectF and do whatever I want with it.

    So my question is why is it that the QRubberBand performance is much better compared to the qwt implementation of drawing ?

    It seems that i forgot one more thing. Why is it that when I change the opacity of the painter with setOpacity() to something less than 0.8 (did not test thoroughly but 0.8 works while 0.7 does not) is like totally transparent ?

    Thank you in advance,
    Xerion
    Last edited by xerionn; 28th April 2011 at 02:54.

Similar Threads

  1. QwtPicker with QwtHistogram
    By cptpingu in forum Qwt
    Replies: 6
    Last Post: 22nd November 2010, 17:05
  2. How to keep rubberband on the QwtPlot?
    By xujiqiang0927 in forum Qwt
    Replies: 2
    Last Post: 3rd June 2010, 02:46
  3. rubberband selection
    By franco.amato in forum Qt Programming
    Replies: 0
    Last Post: 22nd March 2010, 18:55
  4. Zooming with rubberband
    By zgulser in forum Qt Programming
    Replies: 5
    Last Post: 24th February 2010, 12:00
  5. QGV: ItemIgnoresTransformations and RubberBand
    By Vladimir in forum Qt Programming
    Replies: 1
    Last Post: 9th June 2007, 14:38

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.