QWT API (中文) 7.0.1
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
79class QWT_EXPORT QwtWidgetOverlay : public QWidget
80{
81 Q_OBJECT
82public:
119 {
130
148
171 AlphaMask
172 };
173
205 {
216
227
237 DrawOverlay
238 };
239
240 // Constructor with parent widget
241 explicit QwtWidgetOverlay(QWidget*);
242 // Destructor
243 virtual ~QwtWidgetOverlay();
244
245 // Set the mask mode for the overlay
246 void setMaskMode(MaskMode);
247 // Get the current mask mode
248 MaskMode maskMode() const;
249
250 // Set the render mode for the overlay
251 void setRenderMode(RenderMode);
252 // Get the current render mode
253 RenderMode renderMode() const;
254
255 // Event filter for parent widget resize events
256 virtual bool eventFilter(QObject*, QEvent*) override;
257
258public Q_SLOTS:
268 void updateOverlay();
269
270protected:
271 virtual void paintEvent(QPaintEvent*) override;
272 virtual void resizeEvent(QResizeEvent*) override;
273
274 virtual QRegion maskHint() const;
275
287 virtual void drawOverlay(QPainter* painter) const = 0;
288
289private:
290 void updateMask();
291 void draw(QPainter*) const;
292
293private:
294 class PrivateData;
295 PrivateData* m_data;
296};
297
298#endif
控件的覆盖层
Definition qwt_widget_overlay.h:80
MaskMode
掩码模式
Definition qwt_widget_overlay.h:119
@ NoMask
不使用掩码。
Definition qwt_widget_overlay.h:129
@ MaskHint
Definition qwt_widget_overlay.h:147
RenderMode
Definition qwt_widget_overlay.h:205
@ AutoRenderMode
使用光栅绘制引擎时复制缓冲区。
Definition qwt_widget_overlay.h:215
@ CopyAlphaMask
始终复制缓冲区
Definition qwt_widget_overlay.h:226
virtual void drawOverlay(QPainter *painter) const =0
绘制控件覆盖层