QwtWidgetOverlay(3) | Qwt User's Guide | QwtWidgetOverlay(3) |
QwtWidgetOverlay - An overlay for a widget.
#include <qwt_widget_overlay.h>
Inherits QWidget.
Inherited by QwtPickerRubberband, and QwtPickerTracker.
enum MaskMode { NoMask, MaskHint,
AlphaMask }
Mask mode. enum RenderMode { AutoRenderMode,
CopyAlphaMask, DrawOverlay }
Render mode.
QwtWidgetOverlay (QWidget *)
Constructor. virtual ~QwtWidgetOverlay ()
Destructor. void setMaskMode (MaskMode)
Specify how to find the mask for the overlay. MaskMode maskMode
() const
void setRenderMode (RenderMode)
RenderMode renderMode () const
void updateOverlay ()
virtual bool eventFilter (QObject *, QEvent *)
Event filter.
virtual void paintEvent (QPaintEvent *event)
virtual void resizeEvent (QResizeEvent *event)
virtual QRegion maskHint () const
Calculate an approximation for the mask. virtual void drawOverlay
(QPainter *painter) const =0
An overlay for a widget.
The main use case of an widget overlay is to avoid heavy repaint operation of the widget below.
F.e. in combination with the plot canvas an overlay avoid replots as the content of the canvas can be restored from its backing store.
QwtWidgetOverlay is an abstract base class. Deriving classes are supposed to reimplement the following methods:
Internally QwtPlotPicker uses overlays for displaying the rubber band and the tracker text.
See also:
Mask mode. When using masks the widget below gets paint events for the masked regions of the overlay only. Otherwise Qt triggers full repaints. On less powerful hardware ( f.e embedded systems ) - or when using the raster paint engine on a remote desktop - bit blitting is a noticeable operation, that needs to be avoided.
If and how to mask depends on how expensive the calculation of the mask is and how many pixels can be excluded by the mask.
The default setting is MaskHint.
See also:
Enumerator
When a valid maskHint() is available only pixels inside this approximation are checked.
Render mode. For calculating the alpha mask the overlay has already been painted to a temporary QImage. Instead of rendering the overlay twice this buffer can be copied for drawing the overlay.
On graphic systems using the raster paint engine ( QWS, Windows ) it means usually copying some memory only. On X11 it results in an expensive operation building a pixmap and for simple overlays it might not be recommended.
Note:
Enumerator
Constructor.
Parameters:
Draw the widget overlay
Parameters:
Event filter. Resize the overlay according to the size of the parent widget.
Parameters:
Returns:
Calculate an approximation for the mask.
The default implementation returns an invalid region indicating no hint.
Returns:
Returns:
See also:
Paint event
Parameters:
See also:
Returns:
See also:
Resize event
Parameters:
Specify how to find the mask for the overlay.
Parameters:
See also:
Set the render mode
Parameters:
See also:
Recalculate the mask and repaint the overlay
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Wed Jan 2 2019 | Version 6.1.4 |