QwtCompass(3)

πŸ“¦ version 5.2.3a, in epel 9, fedora 43, fedora 44

✨ NAME ✨

QwtCompass β€” bestie, that's genuinely the whole name. No long description, no subtitle, just the widget's name and the vibe. πŸ’…


🌈 SYNOPSIS 🌈

#include <qwt_compass.h>

Inherits QwtDial.

🫢 Public Member Functions 🫢

QwtCompass (QWidget *parent=NULL)
virtual ~QwtCompass ()
const QMap< double, QString > & labelMap () const
QMap< double, QString > & labelMap ()
const QwtCompassRose * rose () const
QwtCompassRose * rose ()
void setLabelMap (const QMap< double, QString > &map)
void setRose (QwtCompassRose *rose)

πŸŽ€ Protected Member Functions πŸŽ€

virtual void drawRose (QPainter *, const QPoint &center, int radius,
    double north, QPalette::ColorGroup) const
virtual void drawScaleContents (QPainter *, const QPoint &center, int
    radius) const
virtual void keyPressEvent (QKeyEvent *)
virtual QwtText scaleLabel (double value) const

🌸 Additional Inherited Members 🌸

lowkey iconic β€” there's a whole section here, and it's empty. The inherited stuff lives over in QwtDial, bestie. Go look there. πŸ¦‹


πŸ’– Detailed Description πŸ’–

A Compass Widget.

Okay so QwtCompass is a widget that displays and lets you enter directions. What's it made of? A scale, an optional needle, and a rose. That's the whole lineup, no cap. 🧭✨

Note: the examples/dials example shows how to use QwtCompass. Go peek at it if you wanna see it in the wild. πŸ’«

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

QwtCompass::QwtCompass (QWidget *parent = NULL) [explicit]

Constructor.

Parameters:

  • parent β€” Parent widget

So here's what you're getting when you spin one up: a compass widget with a scale, no needle and no rose. The default origin is 270.0 with no valid value. It accepts mouse and keyboard inputs, and it has no step size. The default mode is QwtDial::RotateNeedle. That's the whole starter pack. 🎁


πŸ’… Member Function Documentation πŸ’…

void QwtCompass::drawRose (QPainter *painter, const QPoint &center, int radius, double north, QPalette::ColorGroup cg) const [protected], [virtual]

Draw the compass rose. yes, the rose, the moment, the main character 🌹

Parameters:

  • painter β€” Painter
  • center β€” Center of the compass
  • radius β€” radius of the circle, where to paint the rose
  • north β€” Direction pointing north, in degrees counter clockwise
  • cg β€” Color group

void QwtCompass::drawScaleContents (QPainter *painter, const QPoint &center, int radius) const [protected], [virtual]

Draw the contents of the scale. 🎨

Parameters:

  • painter β€” Painter
  • center β€” Center of the content circle
  • radius β€” Radius of the content circle

Reimplemented from QwtDial.

void QwtCompass::keyPressEvent (QKeyEvent *kev) [protected], [virtual]

Handles key events. ⌨️✨

Besides the keys described in QwtDial::keyPressEvent, numbers from 1-9 (without 5, she said what she said πŸ’€) set the direction according to their position on the num pad. fr fr, the numpad layout is the map.

See also: isReadOnly()

Reimplemented from QwtDial.

const QMap< double, QString > & QwtCompass::labelMap () const

Returns: map, mapping values to labels

See also: setLabelMap()

QMap< double, QString > & QwtCompass::labelMap ()

Returns: map, mapping values to labels

See also: setLabelMap()

two flavours, same energy β€” one's const, one's not. pick your fighter. 🫢

const QwtCompassRose * QwtCompass::rose () const

Returns: rose

See also: setRose()

QwtCompassRose * QwtCompass::rose ()

Returns: rose

See also: setRose()

again: const version and non-const version, both serving rose. 🌹

QwtText QwtCompass::scaleLabel (double value) const [protected], [virtual]

Map a value to a corresponding label. 🏷️

Parameters:

  • value β€” Value that will be mapped

Returns: Label, or QString::null

label() looks in a map for a corresponding label for value or return an null text. (yes, "an null text" β€” we're keeping the original's words, bestie, no editing the ancestors πŸ™ˆ)

See also: labelMap(), setLabelMap()

Reimplemented from QwtDial.

void QwtCompass::setLabelMap (const QMap< double, QString > &map)

Set a map, mapping values to labels. πŸ—ΊοΈ

Parameters:

  • map β€” value to label map

The values of the major ticks are found by looking into this map. The default map consists of the labels N, NE, E, SE, S, SW, W, NW. 🌸 cute lil compass directions, obsessed.

Warning: The map will have no effect for values that are no major tick values. Major ticks can be changed by QwtScaleDraw::setScale. so like… don't come crying when it doesn't render, bestie, check your ticks first. 😭

See also: labelMap(), scaleDraw(), setScale()

void QwtCompass::setRose (QwtCompassRose *rose)

Set a rose for the compass. 🌹✨

Parameters:

  • rose β€” Compass rose
Warning: The rose will be deleted, when a different rose is set or in ~QwtCompass. so heads up β€” it takes ownership, it's giving "this is mine now" energy. πŸ’€

See also: rose()


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Qwt User's Guide from the source code. so like… Doxygen wrote this, not me. I just gave it a glow-up. πŸ’–


okay that's the whole page bestie!! πŸ«ΆπŸ’– this was Version 5.2.3, dated Tue Nov 20 2012, and it came to you straight from the Qwt User's Guide. go build something cute with a compass in it. mwah. πŸ’…βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from