Qwt User's Guide 6.2.0

qwt_widget_overlay.h
1 /******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10 #ifndef QWT_WIDGET_OVERLAY_H
11 #define QWT_WIDGET_OVERLAY_H
12
13 #include "qwt_global.h"
14 #include <qwidget.h>
15
16 class QPainter;
17 class QRegion;
18
40 class QWT_EXPORT QwtWidgetOverlay : public QWidget
41 {
42 public:
60 enum MaskMode
61 {
63 NoMask,
64
72 MaskHint,
73
84 AlphaMask
85 };
86
102 enum RenderMode
103 {
105 AutoRenderMode,
106
108 CopyAlphaMask,
109
111 DrawOverlay
112 };
113
114 explicit QwtWidgetOverlay( QWidget* );
115 virtual ~QwtWidgetOverlay();
116
117 void setMaskMode( MaskMode );
118 MaskMode maskMode() const;
119
120 void setRenderMode( RenderMode );
121 RenderMode renderMode() const;
122
123 virtual bool eventFilter( QObject*, QEvent*) QWT_OVERRIDE;
124
125 public Q_SLOTS:
126 void updateOverlay();
127
128 protected:
129 virtual void paintEvent( QPaintEvent* ) QWT_OVERRIDE;
130 virtual void resizeEvent( QResizeEvent* ) QWT_OVERRIDE;
131
132 virtual QRegion maskHint() const;
133
138 virtual void drawOverlay( QPainter* painter ) const = 0;
139
140 private:
141 void updateMask();
142 void draw( QPainter* ) const;
143
144 private:
145 class PrivateData;
146 PrivateData* m_data;
147 };
148
149 #endif
QwtWidgetOverlay
An overlay for a widget.
Definition: qwt_widget_overlay.h:41
QwtWidgetOverlay::MaskMode
MaskMode
Mask mode.
Definition: qwt_widget_overlay.h:61
QwtWidgetOverlay::NoMask
@ NoMask
Don't use a mask.
Definition: qwt_widget_overlay.h:63
QwtWidgetOverlay::MaskHint
@ MaskHint
Use maskHint() as mask.
Definition: qwt_widget_overlay.h:72
QwtWidgetOverlay::RenderMode
RenderMode
Render mode.
Definition: qwt_widget_overlay.h:103
QwtWidgetOverlay::AutoRenderMode
@ AutoRenderMode
Copy the buffer, when using the raster paint engine.
Definition: qwt_widget_overlay.h:105
QwtWidgetOverlay::CopyAlphaMask
@ CopyAlphaMask
Always copy the buffer.
Definition: qwt_widget_overlay.h:108
QwtWidgetOverlay::drawOverlay
virtual void drawOverlay(QPainter *painter) const =0