QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
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 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner → QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 *****************************************************************************/
26
27#ifndef QWT_WIDGET_OVERLAY_H
28#define QWT_WIDGET_OVERLAY_H
29
30#include "qwt_global.h"
31#include <qwidget.h>
32
33class QPainter;
34class QRegion;
35
58class QWT_EXPORT QwtWidgetOverlay : public QWidget
59{
60 Q_OBJECT
61public:
81 {
87
97
109 AlphaMask
110 };
111
129 {
135
141
146 DrawOverlay
147 };
148
149 // Constructor with parent widget
150 explicit QwtWidgetOverlay(QWidget*);
151 // Destructor
152 ~QwtWidgetOverlay() override;
153
154 // Set the mask mode for the overlay
155 void setMaskMode(MaskMode);
156 // Get the current mask mode
157 MaskMode maskMode() const;
158
159 // Set the render mode for the overlay
160 void setRenderMode(RenderMode);
161 // Get the current render mode
162 RenderMode renderMode() const;
163
164 // Event filter for parent widget resize events
165 virtual bool eventFilter(QObject*, QEvent*) override;
166
167public Q_SLOTS:
172 void updateOverlay();
173
174protected:
175 virtual void paintEvent(QPaintEvent*) override;
176 virtual void resizeEvent(QResizeEvent*) override;
177
178 virtual QRegion maskHint() const;
179
185 virtual void drawOverlay(QPainter* painter) const = 0;
186
187private:
188 void updateMask();
189 void draw(QPainter*) const;
190
191private:
192 QWT_DECLARE_PRIVATE(QwtWidgetOverlay)
193};
194
195#endif
An overlay for a widget
Definition qwt_widget_overlay.h:59
MaskMode
Mask mode
Definition qwt_widget_overlay.h:81
@ NoMask
Don't use a mask.
Definition qwt_widget_overlay.h:86
@ MaskHint
Use maskHint() as mask
Definition qwt_widget_overlay.h:96
RenderMode
Render mode
Definition qwt_widget_overlay.h:129
@ AutoRenderMode
Copy the buffer, when using the raster paint engine.
Definition qwt_widget_overlay.h:134
@ CopyAlphaMask
Always copy the buffer
Definition qwt_widget_overlay.h:140
virtual void drawOverlay(QPainter *painter) const =0
Draw the widget overlay