QWT 7.0.1
Loading...
Searching...
No Matches
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
43class QWT_EXPORT QwtColumnRect
44{
45public:
48 {
51
54
57
59 TopToBottom
60 };
61
63 QwtColumnRect() : direction(BottomToTop)
64 {
65 }
66
68 QRectF toRect() const;
69
71 Qt::Orientation orientation() const
72 {
73 if (direction == LeftToRight || direction == RightToLeft)
74 return Qt::Horizontal;
75
76 return Qt::Vertical;
77 }
78
81
84
87};
88
90class QWT_EXPORT QwtColumnSymbol
91{
92public:
97 enum Style
98 {
100 NoStyle = -1,
101
107
113 UserStyle = 1000
114 };
115
121 {
124
127
129 Raised
130 };
131
132public:
133 explicit QwtColumnSymbol(Style = NoStyle);
134 virtual ~QwtColumnSymbol();
135
136 void setFrameStyle(FrameStyle);
137 FrameStyle frameStyle() const;
138
139 void setLineWidth(int width);
140 int lineWidth() const;
141
142 void setStyle(Style);
143 Style style() const;
144
145 void setPen(const QPen& pen);
146 QPen pen() const;
147
148 void setBrush(const QBrush& b);
149 QBrush brush() const;
150
151 virtual void draw(QPainter*, const QwtColumnRect&) const;
152
153protected:
154 void drawBox(QPainter*, const QwtColumnRect&) const;
155
156private:
157 Q_DISABLE_COPY(QwtColumnSymbol)
158
159 class PrivateData;
160 PrivateData* m_data;
161};
162
163#endif
Directed rectangle representing bounding rectangle and orientation of a column.
Definition qwt_column_symbol.h:44
QwtInterval vInterval
Interval for the vertical coordinates.
Definition qwt_column_symbol.h:83
QwtInterval hInterval
Interval for the horizontal coordinates.
Definition qwt_column_symbol.h:80
Direction
Direction of the column.
Definition qwt_column_symbol.h:48
@ LeftToRight
From left to right.
Definition qwt_column_symbol.h:50
@ BottomToTop
From bottom to top.
Definition qwt_column_symbol.h:56
@ RightToLeft
From right to left.
Definition qwt_column_symbol.h:53
Qt::Orientation orientation() const
Definition qwt_column_symbol.h:71
Direction direction
Direction.
Definition qwt_column_symbol.h:86
QwtColumnRect()
Build an rectangle with invalid intervals directed BottomToTop.
Definition qwt_column_symbol.h:63
A drawing primitive for columns.
Definition qwt_column_symbol.h:91
FrameStyle
Frame Style used in Box style().
Definition qwt_column_symbol.h:121
@ NoFrame
No frame.
Definition qwt_column_symbol.h:123
@ Plain
A plain frame style.
Definition qwt_column_symbol.h:126
Style
Style.
Definition qwt_column_symbol.h:98
@ Box
The column is painted with a frame depending on the frameStyle() and lineWidth() using the palette().
Definition qwt_column_symbol.h:106
A class representing an interval.
Definition qwt_interval.h:40