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
18class QPainter;
19class QPalette;
20class QRectF;
21
26class QWT_EXPORT QwtColumnRect
27{
28 public:
31 {
34
37
40
42 TopToBottom
43 };
44
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
65
68
71};
72
74class QWT_EXPORT QwtColumnSymbol
75{
76 public:
81 enum Style
82 {
84 NoStyle = -1,
85
91
97 UserStyle = 1000
98 };
99
105 {
108
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
Directed rectangle representing bounding rectangle and orientation of a column.
QwtInterval vInterval
Interval for the vertical coordinates.
QwtInterval hInterval
Interval for the horizontal coordinates.
Direction
Direction of the column.
@ LeftToRight
From left to right.
@ BottomToTop
From bottom to top.
@ RightToLeft
From right to left.
Qt::Orientation orientation() const
Direction direction
Direction.
QwtColumnRect()
Build an rectangle with invalid intervals directed BottomToTop.
A drawing primitive for columns.
@ Plain
A plain frame style.
A class representing an interval.