QWT API (中文) 7.3.0
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
46class QWT_EXPORT QwtColumnRect
47{
48public:
51 {
54
57
60
62 TopToBottom
63 };
64
68 QwtColumnRect() : direction(BottomToTop)
69 {
70 }
71
73 QRectF toRect() const;
74
76 Qt::Orientation orientation() const
77 {
78 if (direction == LeftToRight || direction == RightToLeft)
79 return Qt::Horizontal;
80
81 return Qt::Vertical;
82 }
83
86
89
92};
93
101class QWT_EXPORT QwtColumnSymbol
102{
103public:
108 enum Style
109 {
111 NoStyle = -1,
112
117
122 UserStyle = 1000
123 };
124
130 {
133
136
138 Raised
139 };
140
141public:
143 explicit QwtColumnSymbol(Style = NoStyle);
146
148 void setFrameStyle(FrameStyle);
150 FrameStyle frameStyle() const;
151
153 void setLineWidth(int width);
155 int lineWidth() const;
156
158 void setStyle(Style);
160 Style style() const;
161
163 void setPen(const QPen& pen);
165 QPen pen() const;
166
168 void setBrush(const QBrush& b);
170 QBrush brush() const;
171
173 virtual void draw(QPainter*, const QwtColumnRect&) const;
174
175protected:
176 void drawBox(QPainter*, const QwtColumnRect&) const;
177
178private:
179 QwtColumnSymbol(const QwtColumnSymbol&) = delete;
180 QwtColumnSymbol& operator=(const QwtColumnSymbol&) = delete;
181
182 QWT_DECLARE_PRIVATE(QwtColumnSymbol)
183};
184
185#endif
Directed rectangle representing bounding rectangle and orientation of a column
Definition qwt_column_symbol.h:47
QwtInterval vInterval
Interval for the vertical coordinates
Definition qwt_column_symbol.h:88
QwtInterval hInterval
Interval for the horizontal coordinates
Definition qwt_column_symbol.h:85
Direction
Direction of the column
Definition qwt_column_symbol.h:51
@ LeftToRight
From left to right
Definition qwt_column_symbol.h:53
@ BottomToTop
From bottom to top
Definition qwt_column_symbol.h:59
@ RightToLeft
From right to left
Definition qwt_column_symbol.h:56
Qt::Orientation orientation() const
Return Orientation
Definition qwt_column_symbol.h:76
Direction direction
Direction
Definition qwt_column_symbol.h:91
QwtColumnRect()
Build a rectangle with invalid intervals directed BottomToTop
Definition qwt_column_symbol.h:68
A drawing primitive for columns
Definition qwt_column_symbol.h:102
FrameStyle
Frame Style used in Box style()
Definition qwt_column_symbol.h:130
@ NoFrame
No frame
Definition qwt_column_symbol.h:132
@ Plain
A plain frame style
Definition qwt_column_symbol.h:135
Style
Style
Definition qwt_column_symbol.h:109
@ Box
The column is painted with a frame depending on the frameStyle() and lineWidth() using the palette().
Definition qwt_column_symbol.h:116
virtual ~QwtColumnSymbol()
Destructor
A class representing an interval
Definition qwt_interval.h:39