rock_widget_collection  0.1
Public Slots | Public Member Functions | Protected Attributes | List of all members
Compass Class Reference

#include <compass.h>

Inherits MultiWidget.

Public Slots

CompassnewInstance ()
 
void setHeading (double value)
 
- Public Slots inherited from MultiWidget
void setActive (bool b)
 
QString getMinimizedLabel ()
 
void setMinimizedLabel (QString label)
 
void childEvent (QChildEvent *event)
 
bool event (QEvent *event)
 
bool isHiddenWhenMinimized () const
 
void hideWhenMin (bool b)
 
- Public Slots inherited from PaintWidget
QObject * addItem (QObject *object)
 
QObject * addPoints (const QList< int > &points_x, const QList< int > &points_y, int groupNr, const QColor &color)
 
QObject * addText (int xPos, int yPos, int groupNr, const QString &text)
 
QObject * addLine (int xPos, int yPos, int groupNr, const QColor &color, int endX, int endY)
 
QObject * addEllipse (int xPos, int yPos, int groupNr, const QColor &color, int width, int height)
 
QObject * addRectangle (int xPos, int yPos, int groupNr, const QColor &color, int width, int height)
 
QObject * addPolyline (int groupNr, const QColor &color, const QList< QPoint > &points)
 
QObject * addPolygon (int groupNr, const QColor &color, const QList< QPoint > &points)
 
QObject * removeItem (QObject *drawItem, bool delete_object)
 
void removeAllItems (bool delete_objects)
 

Public Member Functions

 Compass (QWidget *parent=NULL)
 
- Public Member Functions inherited from MultiWidget
 MultiWidget (QWidget *parent=0)
 
- Public Member Functions inherited from PaintWidget
 PaintWidget (QWidget *parent)
 
 ~PaintWidget ()
 

Protected Attributes

QVBoxLayout * layout
 
double heading
 
QwtCompass * compass
 
QwtCompassMagnetNeedle * needle
 
QLabel * number
 
- Protected Attributes inherited from MultiWidget
bool isActive
 
bool wasHidden
 
- Protected Attributes inherited from PaintWidget
QList< DrawItem * > items
 
QList< int > disabledGroups
 
bool isOpenGL
 

Additional Inherited Members

- Signals inherited from MultiWidget
void activityChanged (bool)
 
- Protected Member Functions inherited from PaintWidget
void drawDrawItemsToImage (QImage &image, bool all=false)
 
void drawDrawItemsToPainter (QPainter &painter, bool all=false)
 
void paintEvent (QPaintEvent *event)
 
- Properties inherited from MultiWidget
bool hideWhenMinimized
 
QString minimizedLabel
 

Detailed Description

Definition at line 14 of file compass.h.

Constructor & Destructor Documentation

◆ Compass()

Compass::Compass ( QWidget *  parent = NULL)

Definition at line 11 of file compass.cc.

11  : MultiWidget(parent)
12 {
13  // add a layout
14  layout = new QVBoxLayout;
15  setLayout(layout);
16 
17  // Label
18  number = new QLabel();
19  //number->setMaximumSize(100,50);
20  number->setAlignment(Qt::AlignHCenter);
21  number->setText("NaN / NaN");
22  layout->addWidget(number);
23 
24  // compass
25  compass = new QwtCompass();
26  layout->addWidget(compass);
27  // not suppored by qwt 6
28  // compass->setScaleOptions(QwtDial::ScaleTicks | QwtDial::ScaleLabel);
29  needle = new QwtCompassMagnetNeedle(QwtCompassMagnetNeedle::TriangleStyle, Qt::white, Qt::red);
30  compass->setNeedle(needle);
31 }
QLabel * number
Definition: compass.h:32
QVBoxLayout * layout
Definition: compass.h:28
QwtCompassMagnetNeedle * needle
Definition: compass.h:31
QwtCompass * compass
Definition: compass.h:30
MultiWidget(QWidget *parent=0)
Definition: MultiWidget.h:18

Member Function Documentation

◆ newInstance

Compass * Compass::newInstance ( )
slot

Definition at line 33 of file compass.cc.

34 {
35  return new Compass();
36 }
Compass(QWidget *parent=NULL)
Definition: compass.cc:11

◆ setHeading

void Compass::setHeading ( double  value)
slot

Definition at line 38 of file compass.cc.

39 {
40  QString heading_text = QString("%1 / %2").arg(v).arg(v/M_PI*180.0);
41 
42  compass->setValue(-v/M_PI*180.0);
43  number->setText(heading_text);
44 }
QLabel * number
Definition: compass.h:32
QwtCompass * compass
Definition: compass.h:30

Member Data Documentation

◆ compass

QwtCompass* Compass::compass
protected

Definition at line 30 of file compass.h.

◆ heading

double Compass::heading
protected

Definition at line 29 of file compass.h.

◆ layout

QVBoxLayout* Compass::layout
protected

Definition at line 28 of file compass.h.

◆ needle

QwtCompassMagnetNeedle* Compass::needle
protected

Definition at line 31 of file compass.h.

◆ number

QLabel* Compass::number
protected

Definition at line 32 of file compass.h.


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