Qwt User's Guide 6.3.0

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
10#ifndef QWT_COLUMN_SYMBOL_H
11#define QWT_COLUMN_SYMBOL_H
12
13#include "qwt_global.h"
14#include "qwt_interval.h"
15
16#include <qnamespace.h>
17
18 class QPainter;
19 class QPalette;
20 class QRectF;
21
26 class QWT_EXPORT QwtColumnRect
27{
28 public:
30 enum Direction
31 {
33 LeftToRight,
34
36 RightToLeft,
37
39 BottomToTop,
40
42 TopToBottom
43 };
44
46 QwtColumnRect()
47 : direction( BottomToTop )
48 {
49 }
50
52 QRectF toRect() const;
53
55 Qt::Orientation orientation() const
56 {
57 if ( direction == LeftToRight || direction == RightToLeft )
58 return Qt::Horizontal;
59
60 return Qt::Vertical;
61 }
62
64 QwtInterval hInterval;
65
67 QwtInterval vInterval;
68
70 Direction direction;
71};
72
74 class QWT_EXPORT QwtColumnSymbol
75{
76 public:
81 enum Style
82 {
84 NoStyle = -1,
85
90 Box,
91
97 UserStyle = 1000
98 };
99
104 enum FrameStyle
105 {
107 NoFrame,
108
110 Plain,
111
113 Raised
114 };
115
116 public:
117 explicit QwtColumnSymbol( Style = NoStyle );
118 virtual ~QwtColumnSymbol();
119
120 void setFrameStyle( FrameStyle );
121 FrameStyle frameStyle() const;
122
123 void setLineWidth( int width );
124 int lineWidth() const;
125
126 void setPalette( const QPalette& );
127 const QPalette& palette() const;
128
129 void setStyle( Style );
130 Style style() const;
131
132 virtual void draw( QPainter*, const QwtColumnRect& ) const;
133
134 protected:
135 void drawBox( QPainter*, const QwtColumnRect& ) const;
136
137 private:
138 Q_DISABLE_COPY(QwtColumnSymbol)
139
140 class PrivateData;
141 PrivateData* m_data;
142};
143
144#endif
QwtColumnRect
Directed rectangle representing bounding rectangle and orientation of a column.
Definition qwt_column_symbol.h:27
QwtColumnRect::vInterval
QwtInterval vInterval
Interval for the vertical coordinates.
Definition qwt_column_symbol.h:67
QwtColumnRect::hInterval
QwtInterval hInterval
Interval for the horizontal coordinates.
Definition qwt_column_symbol.h:64
QwtColumnRect::Direction
Direction
Direction of the column.
Definition qwt_column_symbol.h:31
QwtColumnRect::LeftToRight
@ LeftToRight
From left to right.
Definition qwt_column_symbol.h:33
QwtColumnRect::BottomToTop
@ BottomToTop
From bottom to top.
Definition qwt_column_symbol.h:39
QwtColumnRect::RightToLeft
@ RightToLeft
From right to left.
Definition qwt_column_symbol.h:36
QwtColumnRect::orientation
Qt::Orientation orientation() const
Definition qwt_column_symbol.h:55
QwtColumnRect::direction
Direction direction
Direction.
Definition qwt_column_symbol.h:70
QwtColumnRect::QwtColumnRect
QwtColumnRect()
Build an rectangle with invalid intervals directed BottomToTop.
Definition qwt_column_symbol.h:46
QwtColumnSymbol
A drawing primitive for columns.
Definition qwt_column_symbol.h:75
QwtColumnSymbol::FrameStyle
FrameStyle
Definition qwt_column_symbol.h:105
QwtColumnSymbol::NoFrame
@ NoFrame
No frame.
Definition qwt_column_symbol.h:107
QwtColumnSymbol::Plain
@ Plain
A plain frame style.
Definition qwt_column_symbol.h:110
QwtColumnSymbol::Style
Style
Definition qwt_column_symbol.h:82
QwtColumnSymbol::Box
@ Box
Definition qwt_column_symbol.h:90
QwtInterval
A class representing an interval.
Definition qwt_interval.h:23