QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_column_symbol.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_COLUMN_SYMBOL_H
28#define QWT_COLUMN_SYMBOL_H
29
30#include "qwt_global.h"
31#include "qwt_interval.h"
32
33#include <qnamespace.h>
34
35class QPainter;
36class QPalette;
37class QRectF;
38
53class QWT_EXPORT QwtColumnRect
54{
55public:
58 {
61
64
67
69 TopToBottom
70 };
71
80 QwtColumnRect() : direction(BottomToTop)
81 {
82 }
83
85 QRectF toRect() const;
86
88 Qt::Orientation orientation() const
89 {
90 if (direction == LeftToRight || direction == RightToLeft)
91 return Qt::Horizontal;
92
93 return Qt::Vertical;
94 }
95
98
101
104};
105
121class QWT_EXPORT QwtColumnSymbol
122{
123public:
134 enum Style
135 {
137 NoStyle = -1,
138
148
159 UserStyle = 1000
160 };
161
173 {
176
179
181 Raised
182 };
183
184public:
186 explicit QwtColumnSymbol(Style = NoStyle);
188 virtual ~QwtColumnSymbol();
189
191 void setFrameStyle(FrameStyle);
193 FrameStyle frameStyle() const;
194
196 void setLineWidth(int width);
198 int lineWidth() const;
199
201 void setStyle(Style);
203 Style style() const;
204
206 void setPen(const QPen& pen);
208 QPen pen() const;
209
211 void setBrush(const QBrush& b);
213 QBrush brush() const;
214
216 virtual void draw(QPainter*, const QwtColumnRect&) const;
217
218protected:
219 void drawBox(QPainter*, const QwtColumnRect&) const;
220
221private:
222 Q_DISABLE_COPY(QwtColumnSymbol)
223
224 class PrivateData;
225 PrivateData* m_data;
226};
227
228#endif
表示柱的边界矩形和方向的方向矩形
Definition qwt_column_symbol.h:54
QwtInterval vInterval
垂直坐标的区间
Definition qwt_column_symbol.h:100
QwtInterval hInterval
水平坐标的区间
Definition qwt_column_symbol.h:97
Direction
柱的方向
Definition qwt_column_symbol.h:58
@ LeftToRight
从左到右
Definition qwt_column_symbol.h:60
@ BottomToTop
从下到上
Definition qwt_column_symbol.h:66
@ RightToLeft
从右到左
Definition qwt_column_symbol.h:63
Qt::Orientation orientation() const
返回方向
Definition qwt_column_symbol.h:88
Direction direction
方向
Definition qwt_column_symbol.h:103
QwtColumnRect()
构建一个具有无效区间、方向为 BottomToTop 的矩形
Definition qwt_column_symbol.h:80
柱的绘图基元
Definition qwt_column_symbol.h:122
FrameStyle
Definition qwt_column_symbol.h:173
@ NoFrame
无框架
Definition qwt_column_symbol.h:175
@ Plain
普通框架样式
Definition qwt_column_symbol.h:178
Style
Definition qwt_column_symbol.h:135
@ Box
柱根据 frameStyle() 和 lineWidth() 使用 palette() 绘制一个框架。
Definition qwt_column_symbol.h:147
表示区间的类
Definition qwt_interval.h:45