|
QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
|
An overlay for a widget. More...
#include <qwt_widget_overlay.h>
Classes | |
| class | PrivateData |
Public Types | |
| enum | MaskMode { NoMask , MaskHint , AlphaMask } |
| Mask mode. More... | |
| enum | RenderMode { AutoRenderMode , CopyAlphaMask , DrawOverlay } |
Public Slots | |
| void | updateOverlay () |
| Recalculate the mask and repaint the overlay . | |
Public Member Functions | |
| QwtWidgetOverlay (QWidget *) | |
| Constructor. | |
| virtual | ~QwtWidgetOverlay () |
| Destructor . | |
| void | setMaskMode (MaskMode) |
| Specify how to find the mask for the overlay. | |
| MaskMode | maskMode () const |
| void | setRenderMode (RenderMode) |
| Set the render mode. | |
| RenderMode | renderMode () const |
| virtual bool | eventFilter (QObject *, QEvent *) override |
| Event filter. | |
Protected Member Functions | |
| virtual void | paintEvent (QPaintEvent *) override |
| Paint event | |
| virtual void | resizeEvent (QResizeEvent *) override |
| Resize event | |
| virtual QRegion | maskHint () const |
| Calculate an approximation for the mask. | |
| virtual void | drawOverlay (QPainter *painter) const =0 |
| Draw the widget overlay | |
An overlay for a widget.
Mask mode.
| Enumerator | |
|---|---|
| NoMask | Don't use a mask. . |
| MaskHint | Use maskHint() as mask For many situations a fast approximation is good enough and it is not necessary to build a more detailed mask ( f.e the bounding rectangle of a text ). |
| AlphaMask | Calculate a mask by checking the alpha values Sometimes it is not possible to give a fast approximation and the mask needs to be calculated by drawing the overlay and testing the result. 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.
| Enumerator | |
|---|---|
| AutoRenderMode | Copy the buffer, when using the raster paint engine. . |
| CopyAlphaMask | Always copy the buffer . |
| DrawOverlay | Never copy the buffer . |
|
explicit |
Constructor.
|
virtual |
Destructor .
|
protectedpure virtual |
|
overridevirtual |
Event filter.
|
protectedvirtual |
Calculate an approximation for the mask.
The default implementation returns an invalid region indicating no hint.
Reimplemented in QwtFigureWidgetOverlay.
| QwtWidgetOverlay::MaskMode QwtWidgetOverlay::maskMode | ( | ) | const |
|
overrideprotectedvirtual |
| QwtWidgetOverlay::RenderMode QwtWidgetOverlay::renderMode | ( | ) | const |
|
overrideprotectedvirtual |
Resize event
| event | Resize event |
| void QwtWidgetOverlay::setMaskMode | ( | MaskMode | mode | ) |
Specify how to find the mask for the overlay.
| void QwtWidgetOverlay::setRenderMode | ( | RenderMode | mode | ) |
Set the render mode.
|
slot |
Recalculate the mask and repaint the overlay .
Recalculate the mask and repaint the overlay
.