334 lines
7.8 KiB
Groff
334 lines
7.8 KiB
Groff
.TH "QwtWidgetOverlay" 3 "Sun Jul 18 2021" "Version 6.2.0" "Qwt User's Guide" \" -*- nroff -*-
|
|
.ad l
|
|
.nh
|
|
.SH NAME
|
|
QwtWidgetOverlay \- An overlay for a widget\&.
|
|
|
|
.SH SYNOPSIS
|
|
.br
|
|
.PP
|
|
.PP
|
|
\fC#include <qwt_widget_overlay\&.h>\fP
|
|
.PP
|
|
Inherits QWidget\&.
|
|
.SS "Public Types"
|
|
|
|
.in +1c
|
|
.ti -1c
|
|
.RI "enum \fBMaskMode\fP { \fBNoMask\fP, \fBMaskHint\fP, \fBAlphaMask\fP }"
|
|
.br
|
|
.RI "Mask mode\&. "
|
|
.ti -1c
|
|
.RI "enum \fBRenderMode\fP { \fBAutoRenderMode\fP, \fBCopyAlphaMask\fP, \fBDrawOverlay\fP }"
|
|
.br
|
|
.RI "Render mode\&. "
|
|
.in -1c
|
|
.SS "Public Slots"
|
|
|
|
.in +1c
|
|
.ti -1c
|
|
.RI "void \fBupdateOverlay\fP ()"
|
|
.br
|
|
.in -1c
|
|
.SS "Public Member Functions"
|
|
|
|
.in +1c
|
|
.ti -1c
|
|
.RI "\fBQwtWidgetOverlay\fP (QWidget *)"
|
|
.br
|
|
.RI "Constructor\&. "
|
|
.ti -1c
|
|
.RI "virtual \fB~QwtWidgetOverlay\fP ()"
|
|
.br
|
|
.RI "Destructor\&. "
|
|
.ti -1c
|
|
.RI "void \fBsetMaskMode\fP (\fBMaskMode\fP)"
|
|
.br
|
|
.RI "Specify how to find the mask for the overlay\&. "
|
|
.ti -1c
|
|
.RI "\fBMaskMode\fP \fBmaskMode\fP () const"
|
|
.br
|
|
.ti -1c
|
|
.RI "void \fBsetRenderMode\fP (\fBRenderMode\fP)"
|
|
.br
|
|
.ti -1c
|
|
.RI "\fBRenderMode\fP \fBrenderMode\fP () const"
|
|
.br
|
|
.ti -1c
|
|
.RI "virtual bool \fBeventFilter\fP (QObject *, QEvent *) override"
|
|
.br
|
|
.RI "Event filter\&. "
|
|
.in -1c
|
|
.SS "Protected Member Functions"
|
|
|
|
.in +1c
|
|
.ti -1c
|
|
.RI "virtual void \fBpaintEvent\fP (QPaintEvent *) override"
|
|
.br
|
|
.ti -1c
|
|
.RI "virtual void \fBresizeEvent\fP (QResizeEvent *) override"
|
|
.br
|
|
.ti -1c
|
|
.RI "virtual QRegion \fBmaskHint\fP () const"
|
|
.br
|
|
.RI "Calculate an approximation for the mask\&. "
|
|
.ti -1c
|
|
.RI "virtual void \fBdrawOverlay\fP (QPainter *painter) const =0"
|
|
.br
|
|
.in -1c
|
|
.SH "Detailed Description"
|
|
.PP
|
|
An overlay for a widget\&.
|
|
|
|
The main use case of an widget overlay is to avoid heavy repaint operation of the widget below\&.
|
|
.PP
|
|
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\&.
|
|
.PP
|
|
\fBQwtWidgetOverlay\fP is an abstract base class\&. Deriving classes are supposed to reimplement the following methods:
|
|
.PP
|
|
.IP "\(bu" 2
|
|
\fBdrawOverlay()\fP
|
|
.IP "\(bu" 2
|
|
\fBmaskHint()\fP
|
|
.PP
|
|
.PP
|
|
Internally \fBQwtPlotPicker\fP uses overlays for displaying the rubber band and the tracker text\&.
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBQwtPlotCanvas::BackingStore\fP
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 40 of file qwt_widget_overlay\&.h\&.
|
|
.SH "Member Enumeration Documentation"
|
|
.PP
|
|
.SS "enum \fBQwtWidgetOverlay::MaskMode\fP"
|
|
|
|
.PP
|
|
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\&.
|
|
.PP
|
|
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\&.
|
|
.PP
|
|
The default setting is MaskHint\&.
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBsetMaskMode()\fP, \fBmaskMode()\fP
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
\fBEnumerator\fP
|
|
.in +1c
|
|
.TP
|
|
\fB\fINoMask \fP\fP
|
|
Don't use a mask\&.
|
|
.TP
|
|
\fB\fIMaskHint \fP\fP
|
|
Use \fBmaskHint()\fP 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 )\&.
|
|
.TP
|
|
\fB\fIAlphaMask \fP\fP
|
|
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\&.
|
|
.PP
|
|
When a valid \fBmaskHint()\fP is available only pixels inside this approximation are checked\&.
|
|
.PP
|
|
Definition at line 60 of file qwt_widget_overlay\&.h\&.
|
|
.SS "enum \fBQwtWidgetOverlay::RenderMode\fP"
|
|
|
|
.PP
|
|
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\&.
|
|
.PP
|
|
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\&.
|
|
.PP
|
|
\fBNote\fP
|
|
.RS 4
|
|
The render mode has no effect, when \fBmaskMode()\fP != AlphaMask\&.
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
\fBEnumerator\fP
|
|
.in +1c
|
|
.TP
|
|
\fB\fIAutoRenderMode \fP\fP
|
|
Copy the buffer, when using the raster paint engine\&.
|
|
.TP
|
|
\fB\fICopyAlphaMask \fP\fP
|
|
Always copy the buffer\&.
|
|
.TP
|
|
\fB\fIDrawOverlay \fP\fP
|
|
Never copy the buffer\&.
|
|
.PP
|
|
Definition at line 102 of file qwt_widget_overlay\&.h\&.
|
|
.SH "Constructor & Destructor Documentation"
|
|
.PP
|
|
.SS "QwtWidgetOverlay::QwtWidgetOverlay (QWidget * widget)\fC [explicit]\fP"
|
|
|
|
.PP
|
|
Constructor\&.
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fIwidget\fP Parent widget, where the overlay is aligned to
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 126 of file qwt_widget_overlay\&.cpp\&.
|
|
.SH "Member Function Documentation"
|
|
.PP
|
|
.SS "virtual void QwtWidgetOverlay::drawOverlay (QPainter * painter) const\fC [protected]\fP, \fC [pure virtual]\fP"
|
|
Draw the widget overlay
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fIpainter\fP Painter
|
|
.RE
|
|
.PP
|
|
|
|
.SS "bool QwtWidgetOverlay::eventFilter (QObject * object, QEvent * event)\fC [override]\fP, \fC [virtual]\fP"
|
|
|
|
.PP
|
|
Event filter\&. Resize the overlay according to the size of the parent widget\&.
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fIobject\fP Object to be filtered
|
|
.br
|
|
\fIevent\fP Event
|
|
.RE
|
|
.PP
|
|
\fBReturns\fP
|
|
.RS 4
|
|
See QObject::eventFilter()
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 389 of file qwt_widget_overlay\&.cpp\&.
|
|
.SS "QRegion QwtWidgetOverlay::maskHint () const\fC [protected]\fP, \fC [virtual]\fP"
|
|
|
|
.PP
|
|
Calculate an approximation for the mask\&.
|
|
.IP "\(bu" 2
|
|
MaskHint The hint is used as mask\&.
|
|
.IP "\(bu" 2
|
|
AlphaMask The hint is used to speed up the algorithm for calculating a mask from non transparent pixels
|
|
.IP "\(bu" 2
|
|
NoMask The hint is unused\&.
|
|
.PP
|
|
.PP
|
|
The default implementation returns an invalid region indicating no hint\&.
|
|
.PP
|
|
\fBReturns\fP
|
|
.RS 4
|
|
Hint for the mask
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 373 of file qwt_widget_overlay\&.cpp\&.
|
|
.SS "\fBQwtWidgetOverlay::MaskMode\fP QwtWidgetOverlay::maskMode () const"
|
|
|
|
.PP
|
|
\fBReturns\fP
|
|
.RS 4
|
|
Mode how to find the mask for the overlay
|
|
.RE
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBsetMaskMode()\fP
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 167 of file qwt_widget_overlay\&.cpp\&.
|
|
.SS "void QwtWidgetOverlay::paintEvent (QPaintEvent * event)\fC [override]\fP, \fC [protected]\fP, \fC [virtual]\fP"
|
|
Paint event
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fIevent\fP Paint event
|
|
.RE
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBdrawOverlay()\fP
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 261 of file qwt_widget_overlay\&.cpp\&.
|
|
.SS "\fBQwtWidgetOverlay::RenderMode\fP QwtWidgetOverlay::renderMode () const"
|
|
|
|
.PP
|
|
\fBReturns\fP
|
|
.RS 4
|
|
Render mode
|
|
.RE
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBRenderMode\fP, \fBsetRenderMode()\fP
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 187 of file qwt_widget_overlay\&.cpp\&.
|
|
.SS "void QwtWidgetOverlay::resizeEvent (QResizeEvent * event)\fC [override]\fP, \fC [protected]\fP, \fC [virtual]\fP"
|
|
Resize event
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fIevent\fP Resize event
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 323 of file qwt_widget_overlay\&.cpp\&.
|
|
.SS "void QwtWidgetOverlay::setMaskMode (\fBMaskMode\fP mode)"
|
|
|
|
.PP
|
|
Specify how to find the mask for the overlay\&.
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fImode\fP New mode
|
|
.RE
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBmaskMode()\fP
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 154 of file qwt_widget_overlay\&.cpp\&.
|
|
.SS "void QwtWidgetOverlay::setRenderMode (\fBRenderMode\fP mode)"
|
|
Set the render mode
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fImode\fP Render mode
|
|
.RE
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBRenderMode\fP, \fBrenderMode()\fP
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 178 of file qwt_widget_overlay\&.cpp\&.
|
|
.SS "void QwtWidgetOverlay::updateOverlay ()\fC [slot]\fP"
|
|
Recalculate the mask and repaint the overlay
|
|
.PP
|
|
Definition at line 195 of file qwt_widget_overlay\&.cpp\&.
|
|
|
|
.SH "Author"
|
|
.PP
|
|
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.
|