rock_widget_collection  0.1
Signals | Public Member Functions | List of all members
VirtualJoystick Class Reference

#include <VirtualJoystick.h>

Inherits QWidget.

Signals

void axisChanged (double, double)
 

Public Member Functions

 VirtualJoystick (QWidget *parent, const std::string &name)
 
 ~VirtualJoystick ()
 

Detailed Description

Definition at line 7 of file VirtualJoystick.h.

Constructor & Destructor Documentation

◆ VirtualJoystick()

VirtualJoystick::VirtualJoystick ( QWidget *  parent,
const std::string &  name 
)

Definition at line 5 of file VirtualJoystick.cc.

5  : QWidget(parent)
6 {
7  filled = false;
8 
9  title = new QLabel(tr(name.c_str()), this);
10  axis1 = new QLabel("Axis 1: ", this);
11  axis1->setGeometry(150, 0, axis1->width(), axis1->height());
12  axis2 = new QLabel("Axis 2: ", this);
13  axis2->setGeometry(150, 13, axis1->width(), axis1->height());
14  setFixedSize(250, 250);
15  setMouseTracking(true);
16  followMouse = false;
17  pressed = false;
18  setCursor(Qt::CrossCursor);
19  widgetCenter = rect().center() + QPointF(0,25);
20  painterCenter = widgetCenter - QPointF(0,10);
21  painterAngle = 0;
22  mousePosition = painterCenter;
23  baseGrad = QLinearGradient(widgetCenter-QPoint(38,0), widgetCenter+QPoint(38,0));
24  baseGrad.setColorAt(0, QColor(160, 160, 160));
25  baseGrad.setColorAt(1, QColor(20, 20, 20));
26  baseGrad.setSpread(QGradient::ReflectSpread);
27  baseColor = QColor(80, 80, 80);
28  update();
29  filled = true;
30  startTimer(30);
31 }

◆ ~VirtualJoystick()

VirtualJoystick::~VirtualJoystick ( )

Definition at line 33 of file VirtualJoystick.cc.

34 {
35 }

Member Function Documentation

◆ axisChanged

void VirtualJoystick::axisChanged ( double  ,
double   
)
signal

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