qwt_dial_needle.h
Go to the documentation of this file.
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_DIAL_NEEDLE_H
11 #define QWT_DIAL_NEEDLE_H
12 
13 #include "qwt_global.h"
14 #include <qpalette.h>
15 
16 class QPainter;
17 
28 {
29  public:
30  QwtDialNeedle();
31  virtual ~QwtDialNeedle();
32 
33  virtual void setPalette( const QPalette& );
34  const QPalette& palette() const;
35 
36  virtual void draw( QPainter*, const QPointF& center,
37  double length, double direction,
38  QPalette::ColorGroup = QPalette::Active ) const;
39 
40  protected:
56  virtual void drawNeedle( QPainter* painter,
57  double length, QPalette::ColorGroup colorGroup ) const = 0;
58 
59  virtual void drawKnob( QPainter*, double width,
60  const QBrush&, bool sunken ) const;
61 
62  private:
63  Q_DISABLE_COPY(QwtDialNeedle)
64 
65  QPalette m_palette;
66 };
67 
82 {
83  public:
85  enum Style
86  {
89 
91  Ray
92  };
93 
94  QwtDialSimpleNeedle( Style, bool hasKnob = true,
95  const QColor& mid = Qt::gray, const QColor& base = Qt::darkGray );
96 
97  void setWidth( double width );
98  double width() const;
99 
100  protected:
101  virtual void drawNeedle( QPainter*, double length,
102  QPalette::ColorGroup ) const QWT_OVERRIDE;
103 
104  private:
106  bool m_hasKnob;
107  double m_width;
108 };
109 
128 {
129  public:
131  enum Style
132  {
135 
137  ThinStyle
138  };
139 
140  QwtCompassMagnetNeedle( Style = TriangleStyle,
141  const QColor& light = Qt::white, const QColor& dark = Qt::red );
142 
143  protected:
144  virtual void drawNeedle( QPainter*,
145  double length, QPalette::ColorGroup ) const QWT_OVERRIDE;
146 
147  private:
149 };
150 
165 {
166  public:
168  enum Style
169  {
172 
174  Style2
175  };
176 
177  QwtCompassWindArrow( Style, const QColor& light = Qt::white,
178  const QColor& dark = Qt::gray );
179 
180  protected:
181  virtual void drawNeedle( QPainter*,
182  double length, QPalette::ColorGroup ) const QWT_OVERRIDE;
183 
184  private:
186 };
187 
188 #endif
QwtDialNeedle
Base class for needles that can be used in a QwtDial.
Definition: qwt_dial_needle.h:27
QwtDialNeedle::drawNeedle
virtual void drawNeedle(QPainter *painter, double length, QPalette::ColorGroup colorGroup) const =0
Draw the needle.
QwtDialSimpleNeedle::Arrow
@ Arrow
Arrow.
Definition: qwt_dial_needle.h:88
QwtCompassWindArrow
An indicator for the wind direction.
Definition: qwt_dial_needle.h:164
qwt_global.h
QwtDialSimpleNeedle::Style
Style
Style of the needle.
Definition: qwt_dial_needle.h:85
QwtCompassMagnetNeedle::Style
Style
Style of the needle.
Definition: qwt_dial_needle.h:131
QwtCompassMagnetNeedle::TriangleStyle
@ TriangleStyle
A needle with a triangular shape.
Definition: qwt_dial_needle.h:134
QwtDialSimpleNeedle
A needle for dial widgets.
Definition: qwt_dial_needle.h:81
QwtCompassMagnetNeedle
A magnet needle for compass widgets.
Definition: qwt_dial_needle.h:127
QwtDialSimpleNeedle::m_hasKnob
bool m_hasKnob
Definition: qwt_dial_needle.h:106
QwtCompassMagnetNeedle::m_style
Style m_style
Definition: qwt_dial_needle.h:148
QwtCompassWindArrow::m_style
Style m_style
Definition: qwt_dial_needle.h:185
QWT_OVERRIDE
#define QWT_OVERRIDE
Definition: qwt_global.h:53
QWT_EXPORT
#define QWT_EXPORT
Definition: qwt_global.h:38
QwtCompassWindArrow::Style
Style
Style of the arrow.
Definition: qwt_dial_needle.h:168
QwtCompassWindArrow::Style1
@ Style1
A needle pointing to the center.
Definition: qwt_dial_needle.h:171
QwtDialSimpleNeedle::m_width
double m_width
Definition: qwt_dial_needle.h:107
QwtDialSimpleNeedle::m_style
Style m_style
Definition: qwt_dial_needle.h:105


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45