Qwt User's Guide 6.3.0

Loading...
Searching...
No Matches
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 Q_OBJECT
43
44 public:
62 enum MaskMode
63 {
65 NoMask,
66
74 MaskHint,
75
86 AlphaMask
87 };
88
104 enum RenderMode
105 {
107 AutoRenderMode,
108
110 CopyAlphaMask,
111
113 DrawOverlay
114 };
115
116 explicit QwtWidgetOverlay( QWidget* );
117 virtual ~QwtWidgetOverlay();
118
119 void setMaskMode( MaskMode );
120 MaskMode maskMode() const;
121
122 void setRenderMode( RenderMode );
123 RenderMode renderMode() const;
124
125 virtual bool eventFilter( QObject*, QEvent*) QWT_OVERRIDE;
126
127 public Q_SLOTS:
128 void updateOverlay();
129
130 protected:
131 virtual void paintEvent( QPaintEvent* ) QWT_OVERRIDE;
132 virtual void resizeEvent( QResizeEvent* ) QWT_OVERRIDE;
133
134 virtual QRegion maskHint() const;
135
140 virtual void drawOverlay( QPainter* painter ) const = 0;
141
142 private:
143 void updateMask();
144 void draw( QPainter* ) const;
145
146 private:
147 class PrivateData;
148 PrivateData* m_data;
149};
150
151#endif
QwtWidgetOverlay
An overlay for a widget.
Definition qwt_widget_overlay.h:41
QwtWidgetOverlay::MaskMode
MaskMode
Mask mode.
Definition qwt_widget_overlay.h:63
QwtWidgetOverlay::NoMask
@ NoMask
Don't use a mask.
Definition qwt_widget_overlay.h:65
QwtWidgetOverlay::MaskHint
@ MaskHint
Use maskHint() as mask.
Definition qwt_widget_overlay.h:74
QwtWidgetOverlay::RenderMode
RenderMode
Render mode.
Definition qwt_widget_overlay.h:105
QwtWidgetOverlay::AutoRenderMode
@ AutoRenderMode
Copy the buffer, when using the raster paint engine.
Definition qwt_widget_overlay.h:107
QwtWidgetOverlay::CopyAlphaMask
@ CopyAlphaMask
Always copy the buffer.
Definition qwt_widget_overlay.h:110
QwtWidgetOverlay::drawOverlay
virtual void drawOverlay(QPainter *painter) const =0