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
Bookmarks