qwt_dial_needle.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_DIAL_NEEDLE_H
11 #define QWT_DIAL_NEEDLE_H 1
12 
13 #include "qwt_global.h"
14 #include <qpalette.h>
15 
16 class QPainter;
17 class QPoint;
18 
29 {
30 public:
31  QwtDialNeedle();
32  virtual ~QwtDialNeedle();
33 
34  virtual void setPalette( const QPalette & );
35  const QPalette &palette() const;
36 
37  virtual void draw( QPainter *painter, const QPointF &center,
38  double length, double direction,
39  QPalette::ColorGroup = QPalette::Active ) const;
40 
41 protected:
57  virtual void drawNeedle( QPainter *painter,
58  double length, QPalette::ColorGroup colorGroup ) const = 0;
59 
60  virtual void drawKnob( QPainter *, double width,
61  const QBrush &, bool sunken ) const;
62 
63 private:
64  Q_DISABLE_COPY(QwtDialNeedle)
65 
66  QPalette d_palette;
67 };
68 
83 {
84 public:
86  enum Style
87  {
90 
92  Ray
93  };
94 
95  QwtDialSimpleNeedle( Style, bool hasKnob = true,
96  const QColor &mid = Qt::gray, const QColor &base = Qt::darkGray );
97 
98  void setWidth( double width );
99  double width() const;
100 
101 protected:
102  virtual void drawNeedle( QPainter *, double length,
103  QPalette::ColorGroup ) const;
104 
105 private:
107  bool d_hasKnob;
108  double d_width;
109 };
110 
129 {
130 public:
132  enum Style
133  {
136 
138  ThinStyle
139  };
140 
141  QwtCompassMagnetNeedle( Style = TriangleStyle,
142  const QColor &light = Qt::white, const QColor &dark = Qt::red );
143 
144 protected:
145  virtual void drawNeedle( QPainter *,
146  double length, QPalette::ColorGroup ) const;
147 
148 private:
150 };
151 
166 {
167 public:
169  enum Style
170  {
173 
175  Style2
176  };
177 
178  QwtCompassWindArrow( Style, const QColor &light = Qt::white,
179  const QColor &dark = Qt::gray );
180 
181 protected:
182  virtual void drawNeedle( QPainter *,
183  double length, QPalette::ColorGroup ) const;
184 
185 private:
187 };
188 
189 #endif
A magnet needle for compass widgets.
#define QWT_EXPORT
Definition: qwt_global.h:38
Style
Style of the needle.
Style
Style of the needle.
Base class for needles that can be used in a QwtDial.
virtual void drawNeedle(QPainter *painter, double length, QPalette::ColorGroup colorGroup) const =0
Draw the needle.
Style
Style of the arrow.
An indicator for the wind direction.
A needle pointing to the center.
A needle for dial widgets.
A needle with a triangular shape.
std::size_t length


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