qwt_column_symbol.h
Go to the documentation of this file.
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
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 #include <qpen.h>
16 #include <qsize.h>
17 #include <qrect.h>
18 
19 class QPainter;
20 class QPalette;
21 class QRect;
22 class QwtText;
23 
29 {
30 public:
32  enum Direction
33  {
36 
39 
42 
44  TopToBottom
45  };
46 
49  direction( BottomToTop )
50  {
51  }
52 
54  QRectF toRect() const
55  {
56  QRectF r( hInterval.minValue(), vInterval.minValue(),
57  hInterval.maxValue() - hInterval.minValue(),
58  vInterval.maxValue() - vInterval.minValue() );
59  r = r.normalized();
60 
61  if ( hInterval.borderFlags() & QwtInterval::ExcludeMinimum )
62  r.adjust( 1, 0, 0, 0 );
63  if ( hInterval.borderFlags() & QwtInterval::ExcludeMaximum )
64  r.adjust( 0, 0, -1, 0 );
65  if ( vInterval.borderFlags() & QwtInterval::ExcludeMinimum )
66  r.adjust( 0, 1, 0, 0 );
67  if ( vInterval.borderFlags() & QwtInterval::ExcludeMaximum )
68  r.adjust( 0, 0, 0, -1 );
69 
70  return r;
71  }
72 
74  Qt::Orientation orientation() const
75  {
76  if ( direction == LeftToRight || direction == RightToLeft )
77  return Qt::Horizontal;
78 
79  return Qt::Vertical;
80  }
81 
84 
87 
90 };
91 
94 {
95 public:
100  enum Style
101  {
103  NoStyle = -1,
104 
110 
116  UserStyle = 1000
117  };
118 
124  {
127 
130 
132  Raised
133  };
134 
135 public:
136  explicit QwtColumnSymbol( Style = NoStyle );
137  virtual ~QwtColumnSymbol();
138 
139  void setFrameStyle( FrameStyle style );
140  FrameStyle frameStyle() const;
141 
142  void setLineWidth( int width );
143  int lineWidth() const;
144 
145  void setPalette( const QPalette & );
146  const QPalette &palette() const;
147 
148  void setStyle( Style );
149  Style style() const;
150 
151  virtual void draw( QPainter *, const QwtColumnRect & ) const;
152 
153 protected:
154  void drawBox( QPainter *, const QwtColumnRect & ) const;
155 
156 private:
157  Q_DISABLE_COPY(QwtColumnSymbol)
158 
159  class PrivateData;
160  PrivateData* d_data;
161 };
162 
163 #endif
Qt::Orientation orientation() const
QwtInterval vInterval
Interval for the vertical coordinates.
A plain frame style.
QwtColumnRect()
Build an rectangle with invalid intervals directed BottomToTop.
A class representing an interval.
Definition: qwt_interval.h:26
#define QWT_EXPORT
Definition: qwt_global.h:38
Max value is not included in the interval.
Definition: qwt_interval.h:42
QRectF toRect() const
From left to right.
A drawing primitive for columns.
Direction direction
Direction.
A class representing a text.
Definition: qwt_text.h:51
Min value is not included in the interval.
Definition: qwt_interval.h:39
From bottom to top.
Directed rectangle representing bounding rectangle and orientation of a column.
Direction
Direction of the column.
QwtInterval hInterval
Interval for the horizontal coordinates.
From right to left.


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:17