QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | List of all members
QwtCompass Class Reference

A Compass Widget. More...

#include <qwt_compass.h>

Inheritance diagram for QwtCompass:
QwtDial QwtAbstractSlider QwtAbstractScale

Classes

class  PrivateData
 

Public Member Functions

 QwtCompass (QWidget *parent=nullptr)
 Constructor.
 
virtual ~QwtCompass ()
 Destructor .
 
void setRose (QwtCompassRose *rose)
 Set a rose for the compass.
 
const QwtCompassRoserose () const
 Get the compass rose.
 
QwtCompassRoserose ()
 Get the compass rose.
 
- Public Member Functions inherited from QwtDial
 QwtDial (QWidget *parent=nullptr)
 Constructor.
 
virtual ~QwtDial ()
 Destructor.
 
void setFrameShadow (Shadow)
 Set the frame shadow.
 
Shadow frameShadow () const
 Return the frame shadow.
 
void setLineWidth (int)
 Set the line width.
 
int lineWidth () const
 Return the line width.
 
void setMode (Mode)
 Set the mode.
 
Mode mode () const
 Return the mode.
 
void setScaleArc (double minArc, double maxArc)
 Set the scale arc range.
 
void setMinScaleArc (double)
 Set the minimum scale arc.
 
double minScaleArc () const
 Return the minimum scale arc.
 
void setMaxScaleArc (double)
 Set the maximum scale arc.
 
double maxScaleArc () const
 Return the maximum scale arc.
 
virtual void setOrigin (double)
 Set the origin.
 
double origin () const
 Return the origin.
 
void setNeedle (QwtDialNeedle *)
 Set the needle.
 
const QwtDialNeedleneedle () const
 Return the needle (const version)
 
QwtDialNeedleneedle ()
 Return the needle.
 
QRect boundingRect () const
 Return the bounding rectangle.
 
QRect innerRect () const
 Return the inner rectangle.
 
virtual QRect scaleInnerRect () const
 Return the scale inner rectangle.
 
virtual QSize sizeHint () const override
 Return the size hint.
 
virtual QSize minimumSizeHint () const override
 Return the minimum size hint.
 
void setScaleDraw (QwtRoundScaleDraw *)
 Set the scale draw.
 
QwtRoundScaleDrawscaleDraw ()
 Return the scale draw.
 
const QwtRoundScaleDrawscaleDraw () const
 Return the scale draw (const version)
 
- Public Member Functions inherited from QwtAbstractSlider
 QwtAbstractSlider (QWidget *parent=nullptr)
 Constructor for QwtAbstractSlider (English only)
 
virtual ~QwtAbstractSlider ()
 Destructor for QwtAbstractSlider (English only)
 
void setValid (bool)
 Set whether the slider is valid (English only)
 
bool isValid () const
 Return whether the slider is valid (English only)
 
double value () const
 Return the current value (English only)
 
void setWrapping (bool)
 Set whether wrapping is enabled (English only)
 
bool wrapping () const
 Return whether wrapping is enabled (English only)
 
void setTotalSteps (uint)
 Set the total number of steps (English only)
 
uint totalSteps () const
 Return the total number of steps (English only)
 
void setSingleSteps (uint)
 Set the number of single steps (English only)
 
uint singleSteps () const
 Return the number of single steps (English only)
 
void setPageSteps (uint)
 Set the number of page steps (English only)
 
uint pageSteps () const
 Return the number of page steps (English only)
 
void setStepAlignment (bool)
 Set whether step alignment is enabled (English only)
 
bool stepAlignment () const
 Return whether step alignment is enabled (English only)
 
void setTracking (bool)
 Set whether tracking is enabled (English only)
 
bool isTracking () const
 Return whether tracking is enabled (English only)
 
void setReadOnly (bool)
 Set whether the slider is read-only (English only)
 
bool isReadOnly () const
 Return whether the slider is read-only (English only)
 
void setInvertedControls (bool)
 Set whether controls are inverted (English only)
 
bool invertedControls () const
 Return whether controls are inverted (English only)
 
- Public Member Functions inherited from QwtAbstractScale
 QwtAbstractScale (QWidget *parent=nullptr)
 Constructor for QwtAbstractScale.
 
virtual ~QwtAbstractScale ()
 Destructor for QwtAbstractScale .
 
void setScale (double lowerBound, double upperBound)
 Specify a scale by interval bounds.
 
void setScale (const QwtInterval &)
 Specify a scale by interval.
 
void setScale (const QwtScaleDiv &)
 Specify a scale by scale division.
 
const QwtScaleDivscaleDiv () const
 Return the scale division.
 
void setLowerBound (double value)
 Set the lower bound of the scale.
 
double lowerBound () const
 Return the lower bound of the scale.
 
void setUpperBound (double value)
 Set the upper bound of the scale.
 
double upperBound () const
 Return the upper bound of the scale.
 
void setScaleStepSize (double stepSize)
 Set the step size used for calculating scale division.
 
double scaleStepSize () const
 Return the step size hint.
 
void setScaleMaxMajor (int ticks)
 Set the maximum number of major tick intervals.
 
int scaleMaxMinor () const
 Return the maximum number of minor tick intervals.
 
void setScaleMaxMinor (int ticks)
 Set the maximum number of minor tick intervals.
 
int scaleMaxMajor () const
 Return the maximum number of major tick intervals.
 
void setScaleEngine (QwtScaleEngine *)
 Set the scale engine.
 
const QwtScaleEnginescaleEngine () const
 Return the scale engine (const version)
 
QwtScaleEnginescaleEngine ()
 Return the scale engine (non-const version)
 
int transform (double) const
 Transform a scale value to widget coordinates.
 
double invTransform (int) const
 Transform a widget coordinate to scale value.
 
bool isInverted () const
 Check if scale is inverted.
 
double minimum () const
 Return the minimum boundary.
 
double maximum () const
 Return the maximum boundary.
 
const QwtScaleMapscaleMap () const
 Return the scale map.
 

Protected Member Functions

virtual void drawRose (QPainter *, const QPointF &center, double radius, double north, QPalette::ColorGroup) const
 Draw the compass rose.
 
virtual void drawScaleContents (QPainter *, const QPointF &center, double radius) const override
 Draw the contents of the scale.
 
virtual void keyPressEvent (QKeyEvent *) override
 Handles key events.
 
- Protected Member Functions inherited from QwtDial
virtual void wheelEvent (QWheelEvent *) override
 Wheel Event handler.
 
virtual void paintEvent (QPaintEvent *) override
 Paint the dial.
 
virtual void changeEvent (QEvent *) override
 Change Event handler.
 
virtual void drawFrame (QPainter *)
 Draw the frame around the dial.
 
virtual void drawContents (QPainter *) const
 Draw the contents inside the frame.
 
virtual void drawFocusIndicator (QPainter *) const
 Draw the focus indicator.
 
void invalidateCache ()
 Invalidate the internal caches used to speed up repainting .
 
virtual void drawScale (QPainter *, const QPointF &center, double radius) const
 Draw the scale.
 
virtual void drawNeedle (QPainter *, const QPointF &, double radius, double direction, QPalette::ColorGroup) const
 Draw the needle.
 
virtual double scrolledTo (const QPoint &) const override
 Determine the value for a new position of the slider handle.
 
virtual bool isScrollPosition (const QPoint &) const override
 Determine what to do when the user presses a mouse button.
 
virtual void sliderChange () override
 Handle slider changes (English only)
 
virtual void scaleChange () override
 Invalidate the internal caches and call QwtAbstractSlider::scaleChange()
 
- Protected Member Functions inherited from QwtAbstractSlider
virtual void mousePressEvent (QMouseEvent *) override
 Handle mouse press events (English only)
 
virtual void mouseReleaseEvent (QMouseEvent *) override
 Handle mouse release events (English only)
 
virtual void mouseMoveEvent (QMouseEvent *) override
 Handle mouse move events (English only)
 
void incrementValue (int stepCount)
 Increment the value by a number of steps (English only)
 
double incrementedValue (double value, int stepCount) const
 Calculate incremented value (English only)
 
- Protected Member Functions inherited from QwtAbstractScale
void rescale (double lowerBound, double upperBound, double stepSize)
 Recalculate scale and update scale draw (English only)
 
void setAbstractScaleDraw (QwtAbstractScaleDraw *)
 Set the scale draw object (English only)
 
const QwtAbstractScaleDrawabstractScaleDraw () const
 Return the scale draw (const version) (English only)
 
QwtAbstractScaleDrawabstractScaleDraw ()
 Return the scale draw (non-const version) (English only)
 
void updateScaleDraw ()
 Update the scale draw (English only)
 

Additional Inherited Members

- Public Types inherited from QwtDial
enum  Shadow { Plain = QFrame::Plain , Raised = QFrame::Raised , Sunken = QFrame::Sunken }
 Frame shadow. More...
 
enum  Mode { RotateNeedle , RotateScale }
 Mode controlling whether the needle or the scale is rotating . More...
 
- Public Slots inherited from QwtAbstractSlider
void setValue (double value)
 Set the slider value (English only)
 
- Signals inherited from QwtAbstractSlider
void valueChanged (double value)
 Notify a change of value.
 
void sliderPressed ()
 Signal emitted when the user presses the movable part of the slider .
 
void sliderReleased ()
 Signal emitted when the user releases the movable part of the slider .
 
void sliderMoved (double value)
 Signal emitted when the user moves the slider with the mouse.
 
- Properties inherited from QwtDial
int lineWidth
 
Shadow frameShadow
 
Mode mode
 
double origin
 
double minScaleArc
 
double maxScaleArc
 
- Properties inherited from QwtAbstractSlider
double value
 
uint totalSteps
 
uint singleSteps
 
uint pageSteps
 
bool stepAlignment
 
bool readOnly
 
bool tracking
 
bool wrapping
 
bool invertedControls
 
- Properties inherited from QwtAbstractScale
double lowerBound
 
double upperBound
 
int scaleMaxMajor
 
int scaleMaxMinor
 
double scaleStepSize
 

Detailed Description

A Compass Widget.

Constructor & Destructor Documentation

◆ QwtCompass()

QwtCompass::QwtCompass ( QWidget *  parent = nullptr)
explicit

Constructor.

◆ ~QwtCompass()

QwtCompass::~QwtCompass ( )
virtual

Destructor .

Member Function Documentation

◆ drawRose()

void QwtCompass::drawRose ( QPainter *  painter,
const QPointF &  center,
double  radius,
double  north,
QPalette::ColorGroup  cg 
) const
protectedvirtual

Draw the compass rose.

Parameters
painterPainter
centerCenter of the compass
radiusof the circle, where to paint the rose
northDirection pointing north, in degrees counter clockwise
cgColor group

◆ drawScaleContents()

void QwtCompass::drawScaleContents ( QPainter *  painter,
const QPointF &  center,
double  radius 
) const
overrideprotectedvirtual

Draw the contents of the scale.

Parameters
painterPainter
centerCenter of the content circle
radiusRadius of the content circle

Reimplemented from QwtDial.

◆ keyPressEvent()

void QwtCompass::keyPressEvent ( QKeyEvent *  kev)
overrideprotectedvirtual

Handles key events.

Beside the keys described in QwtDial::keyPressEvent numbers from 1-9 (without 5) set the direction according to their position on the num pad.

See also
isReadOnly()

Reimplemented from QwtAbstractSlider.

◆ rose() [1/2]

QwtCompassRose * QwtCompass::rose ( )

Get the compass rose.

Returns
The compass rose
See also
setRose()

◆ rose() [2/2]

const QwtCompassRose * QwtCompass::rose ( ) const

Get the compass rose.

Returns
The compass rose (const version)
See also
setRose()

◆ setRose()

void QwtCompass::setRose ( QwtCompassRose rose)

Set a rose for the compass.


The documentation for this class was generated from the following files: