Qwt User's Guide: QwtCompassMagnetNeedle Class Reference

Qwt User's Guide 6.0.1

- Main Page
- Related Pages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions

# QwtCompassMagnetNeedle Class Reference

A magnet needle for compass widgets. More...

`#include <qwt_dial_needle.h>`

Inheritance diagram for QwtCompassMagnetNeedle:
[legend]

List of all members.

## Public Types
enum | Style { TriangleStyle, ThinStyle }
## Public Member Functions
virtual void | draw (QPainter *painter, const QPointF &center, double length, double direction, QPalette::ColorGroup=QPalette::Active) const
const QPalette & | palette () const
| QwtCompassMagnetNeedle (Style=TriangleStyle, const QColor &light=Qt::white, const QColor &dark=Qt::red)
virtual void | setPalette (const QPalette &)
## Protected Member Functions
virtual void | drawKnob (QPainter *, double width, const QBrush &, bool sunken) const
virtual void | drawNeedle (QPainter *, double length, QPalette::ColorGroup) const

## Detailed Description

A magnet needle for compass widgets.

A magnet needle points to two opposite directions indicating north and south.

The following colors are used:

- QPalette::Light
  Used for pointing south
- QPalette::Dark
  Used for pointing north
- QPalette::Base
  Knob (ThinStyle only)

See also:
  QwtDial, QwtCompass

## Member Enumeration Documentation

enum QwtCompassMagnetNeedle::Style

Style of the needle.

Enumerator:

  TriangleStyle | A needle with a triangular shape.
  ThinStyle | A thin needle.

## Constructor & Destructor Documentation

QwtCompassMagnetNeedle::QwtCompassMagnetNeedle | ( | Style | style = `TriangleStyle`,
|  | const QColor & | light = `Qt::white`,
|  | const QColor & | dark = `Qt::red`
| ) |  |

Constructor.

## Member Function Documentation

void QwtDialNeedle::draw | ( | QPainter * | painter,
|  | const QPointF & | center,
|  | double | length,
|  | double | direction,
|  | QPalette::ColorGroup | colorGroup = `QPalette::Active`
| ) |  | const`[virtual, inherited]`

Draw the needle

Parameters:

  painter | Painter
  center | Center of the dial, start position for the needle
  length | Length of the needle
  direction | Direction of the needle, in degrees counter clockwise
  colorGroup | Color group, used for painting

void QwtDialNeedle::drawKnob | ( | QPainter * | painter,
|  | double | width,
|  | const QBrush & | brush,
|  | bool | sunken
| ) |  | const`[protected, virtual, inherited]`

Draw the knob.

void QwtCompassMagnetNeedle::drawNeedle | ( | QPainter * | painter,
|  | double | length,
|  | QPalette::ColorGroup | colorGroup
| ) |  | const`[protected, virtual]`

Draw the needle

Parameters:

  painter | Painter
  length | Length of the needle
  colorGroup | Color group, used for painting

Implements QwtDialNeedle.

const QPalette & QwtDialNeedle::palette | ( |  | ) | const`[inherited]`

Returns:
  the palette of the needle.

void QwtDialNeedle::setPalette | ( | const QPalette & | palette | ) | `[virtual, inherited]`

Sets the palette for the needle.

Parameters:

  palette | New Palette