QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_painter_command.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_PAINTER_COMMAND_H
28#define QWT_PAINTER_COMMAND_H
29
30#include "qwt_global.h"
31
32#include <qpaintengine.h>
33#include <qpixmap.h>
34#include <qimage.h>
35#include <qpolygon.h>
36#include <qpainterpath.h>
37
38class QPainterPath;
39
60class QWT_EXPORT QwtPainterCommand
61{
62 public:
64 enum Type
65 {
67 Invalid = -1,
68
71
74
77
79 State
80 };
81
84 {
85 QRectF rect;
86 QPixmap pixmap;
87 QRectF subRect;
88 };
89
91 struct ImageData
92 {
93 QRectF rect;
94 QImage image;
95 QRectF subRect;
96 Qt::ImageConversionFlags flags;
97 };
98
101 {
102 QPaintEngine::DirtyFlags flags;
103
104 QPen pen;
105 QBrush brush;
106 QPointF brushOrigin;
107 QBrush backgroundBrush;
108 Qt::BGMode backgroundMode;
109 QFont font;
110 QTransform transform;
111
112 Qt::ClipOperation clipOperation;
113 QRegion clipRegion;
114 QPainterPath clipPath;
115 bool isClipEnabled;
116
117 QPainter::RenderHints renderHints;
118 QPainter::CompositionMode compositionMode;
119 qreal opacity;
120 };
121
124
125 explicit QwtPainterCommand( const QPainterPath& );
126
127 QwtPainterCommand( const QRectF& rect,
128 const QPixmap&, const QRectF& subRect );
129
130 QwtPainterCommand( const QRectF& rect,
131 const QImage&, const QRectF& subRect,
132 Qt::ImageConversionFlags );
133
134 explicit QwtPainterCommand( const QPaintEngineState& );
135
137
138 QwtPainterCommand& operator=(const QwtPainterCommand& );
139
140 Type type() const;
141
142 QPainterPath* path();
143 const QPainterPath* path() const;
144
145 PixmapData* pixmapData();
146 const PixmapData* pixmapData() const;
147
148 ImageData* imageData();
149 const ImageData* imageData() const;
150
151 StateData* stateData();
152 const StateData* stateData() const;
153
154 private:
155 void copy( const QwtPainterCommand& );
156 void reset();
157
158 Type m_type;
159
160 union
161 {
162 QPainterPath* m_path;
163 PixmapData* m_pixmapData;
164 ImageData* m_imageData;
165 StateData* m_stateData;
166 };
167};
168
171{
172 return m_type;
173}
174
176inline const QPainterPath* QwtPainterCommand::path() const
177{
178 return m_path;
179}
180
184{
185 return m_pixmapData;
186}
187
191{
192 return m_imageData;
193}
194
198{
199 return m_stateData;
200}
201
202#endif
表示QPainter和QPaintDevice之间的绘制操作属性
Definition qwt_painter_command.h:61
QPainterPath * path()
Definition qwt_painter_command.cpp:308
Type
Type of the paint command
Definition qwt_painter_command.h:65
@ Pixmap
Draw a QPixmap
Definition qwt_painter_command.h:73
@ Path
Draw a QPainterPath
Definition qwt_painter_command.h:70
@ Image
Draw a QImage
Definition qwt_painter_command.h:76
Type type() const
Definition qwt_painter_command.h:170
PixmapData * pixmapData()
Definition qwt_painter_command.cpp:314
ImageData * imageData()
Definition qwt_painter_command.cpp:320
StateData * stateData()
Definition qwt_painter_command.cpp:326
Attributes how to paint a QImage
Definition qwt_painter_command.h:92
Attributes how to paint a QPixmap
Definition qwt_painter_command.h:84
Attributes of a state change
Definition qwt_painter_command.h:101