9 #ifndef UI_JOYSTICKWIDGET_H 10 #define UI_JOYSTICKWIDGET_H 12 #include <QtCore/QVariant> 13 #include <QtGui/QAction> 14 #include <QtGui/QApplication> 15 #include <QtGui/QButtonGroup> 16 #include <QtGui/QDoubleSpinBox> 17 #include <QtGui/QFormLayout> 18 #include <QtGui/QGroupBox> 19 #include <QtGui/QHeaderView> 20 #include <QtGui/QLabel> 21 #include <QtGui/QSlider> 22 #include <QtGui/QSpinBox> 23 #include <QtGui/QWidget> 56 void setupUi(QWidget *JoystickWidgetClass)
58 if (JoystickWidgetClass->objectName().isEmpty())
59 JoystickWidgetClass->setObjectName(QString::fromUtf8(
"JoystickWidgetClass"));
60 JoystickWidgetClass->resize(360, 450);
61 JoystickWidgetClass->setMouseTracking(
true);
62 groupBoxMovement =
new QGroupBox(JoystickWidgetClass);
63 groupBoxMovement->setObjectName(QString::fromUtf8(
"groupBoxMovement"));
64 groupBoxMovement->setGeometry(QRect(10, 0, 341, 330));
65 QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
66 sizePolicy.setHorizontalStretch(0);
67 sizePolicy.setVerticalStretch(0);
68 sizePolicy.setHeightForWidth(groupBoxMovement->sizePolicy().hasHeightForWidth());
69 groupBoxMovement->setSizePolicy(sizePolicy);
70 groupBoxMovement->setMouseTracking(
true);
71 labelSetValue =
new QLabel(groupBoxMovement);
72 labelSetValue->setObjectName(QString::fromUtf8(
"labelSetValue"));
73 labelSetValue->setGeometry(QRect(260, 30, 71, 18));
74 labelSetValue->setContextMenuPolicy(Qt::NoContextMenu);
75 labelNewText =
new QLabel(groupBoxMovement);
76 labelNewText->setObjectName(QString::fromUtf8(
"labelNewText"));
77 labelNewText->setGeometry(QRect(230, 10, 20, 20));
78 labelNewText->setContextMenuPolicy(Qt::NoContextMenu);
79 labelSetText =
new QLabel(groupBoxMovement);
80 labelSetText->setObjectName(QString::fromUtf8(
"labelSetText"));
81 labelSetText->setGeometry(QRect(230, 30, 20, 20));
82 labelSetText->setContextMenuPolicy(Qt::NoContextMenu);
83 labelNewValue =
new QLabel(groupBoxMovement);
84 labelNewValue->setObjectName(QString::fromUtf8(
"labelNewValue"));
85 labelNewValue->setGeometry(QRect(260, 10, 81, 18));
86 labelNewValue->setContextMenuPolicy(Qt::NoContextMenu);
87 vSliderLeft =
new QSlider(groupBoxMovement);
88 vSliderLeft->setObjectName(QString::fromUtf8(
"vSliderLeft"));
89 vSliderLeft->setGeometry(QRect(230, 100, 21, 211));
90 vSliderLeft->setMinimum(-100);
91 vSliderLeft->setMaximum(100);
92 vSliderLeft->setOrientation(Qt::Vertical);
93 vSliderLeft->setTickPosition(QSlider::TicksBelow);
94 vSliderLeft->setTickInterval(100);
95 vSliderRight =
new QSlider(groupBoxMovement);
96 vSliderRight->setObjectName(QString::fromUtf8(
"vSliderRight"));
97 vSliderRight->setGeometry(QRect(300, 100, 21, 211));
98 vSliderRight->setMinimum(-100);
99 vSliderRight->setMaximum(100);
100 vSliderRight->setOrientation(Qt::Vertical);
101 vSliderRight->setTickPosition(QSlider::TicksAbove);
102 vSliderRight->setTickInterval(100);
103 labelLeft =
new QLabel(groupBoxMovement);
104 labelLeft->setObjectName(QString::fromUtf8(
"labelLeft"));
105 labelLeft->setGeometry(QRect(230, 70, 21, 16));
106 labelRight =
new QLabel(groupBoxMovement);
107 labelRight->setObjectName(QString::fromUtf8(
"labelRight"));
108 labelRight->setGeometry(QRect(300, 70, 21, 16));
109 labelZero =
new QLabel(groupBoxMovement);
110 labelZero->setObjectName(QString::fromUtf8(
"labelZero"));
111 labelZero->setGeometry(QRect(270, 195, 20, 20));
113 font.setPointSize(12);
116 labelZero->setFont(font);
118 crossW->setObjectName(QString::fromUtf8(
"crossW"));
119 crossW->setGeometry(QRect(15, 20, 200, 300));
120 groupBoxSetup =
new QGroupBox(JoystickWidgetClass);
121 groupBoxSetup->setObjectName(QString::fromUtf8(
"groupBoxSetup"));
122 groupBoxSetup->setGeometry(QRect(10, 330, 341, 111));
123 formLayoutWidget =
new QWidget(groupBoxSetup);
124 formLayoutWidget->setObjectName(QString::fromUtf8(
"formLayoutWidget"));
125 formLayoutWidget->setGeometry(QRect(30, 20, 121, 81));
126 formLayoutZeroZone =
new QFormLayout(formLayoutWidget);
127 formLayoutZeroZone->setContentsMargins(3, 3, 3, 3);
128 formLayoutZeroZone->setObjectName(QString::fromUtf8(
"formLayoutZeroZone"));
129 formLayoutZeroZone->setContentsMargins(0, 0, 0, 0);
130 labelZeroZoneX =
new QLabel(formLayoutWidget);
131 labelZeroZoneX->setObjectName(QString::fromUtf8(
"labelZeroZoneX"));
133 formLayoutZeroZone->setWidget(0, QFormLayout::LabelRole, labelZeroZoneX);
135 labelZeroZoneY =
new QLabel(formLayoutWidget);
136 labelZeroZoneY->setObjectName(QString::fromUtf8(
"labelZeroZoneY"));
138 formLayoutZeroZone->setWidget(1, QFormLayout::LabelRole, labelZeroZoneY);
140 labelZeroZone0 =
new QLabel(formLayoutWidget);
141 labelZeroZone0->setObjectName(QString::fromUtf8(
"labelZeroZone0"));
143 formLayoutZeroZone->setWidget(2, QFormLayout::LabelRole, labelZeroZone0);
145 spinBoxZeroZoneX =
new QSpinBox(formLayoutWidget);
146 spinBoxZeroZoneX->setObjectName(QString::fromUtf8(
"spinBoxZeroZoneX"));
147 spinBoxZeroZoneX->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
148 spinBoxZeroZoneX->setMaximum(20);
150 formLayoutZeroZone->setWidget(0, QFormLayout::FieldRole, spinBoxZeroZoneX);
152 spinBoxZeroZoneY =
new QSpinBox(formLayoutWidget);
153 spinBoxZeroZoneY->setObjectName(QString::fromUtf8(
"spinBoxZeroZoneY"));
154 spinBoxZeroZoneY->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
155 spinBoxZeroZoneY->setMaximum(20);
157 formLayoutZeroZone->setWidget(1, QFormLayout::FieldRole, spinBoxZeroZoneY);
159 spinBoxZeroZone0 =
new QSpinBox(formLayoutWidget);
160 spinBoxZeroZone0->setObjectName(QString::fromUtf8(
"spinBoxZeroZone0"));
161 spinBoxZeroZone0->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
162 spinBoxZeroZone0->setMaximum(20);
164 formLayoutZeroZone->setWidget(2, QFormLayout::FieldRole, spinBoxZeroZone0);
166 formLayoutWidget_2 =
new QWidget(groupBoxSetup);
167 formLayoutWidget_2->setObjectName(QString::fromUtf8(
"formLayoutWidget_2"));
168 formLayoutWidget_2->setGeometry(QRect(190, 20, 131, 80));
169 formLayout =
new QFormLayout(formLayoutWidget_2);
170 formLayout->setContentsMargins(3, 3, 3, 3);
171 formLayout->setObjectName(QString::fromUtf8(
"formLayout"));
172 formLayout->setContentsMargins(0, 0, 0, 0);
173 labelMaxSpeed =
new QLabel(formLayoutWidget_2);
174 labelMaxSpeed->setObjectName(QString::fromUtf8(
"labelMaxSpeed"));
176 formLayout->setWidget(0, QFormLayout::LabelRole, labelMaxSpeed);
178 doubleSpinBoxMaxSpeed =
new QDoubleSpinBox(formLayoutWidget_2);
179 doubleSpinBoxMaxSpeed->setObjectName(QString::fromUtf8(
"doubleSpinBoxMaxSpeed"));
180 doubleSpinBoxMaxSpeed->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
181 doubleSpinBoxMaxSpeed->setMaximum(100);
182 doubleSpinBoxMaxSpeed->setValue(12);
184 formLayout->setWidget(0, QFormLayout::FieldRole, doubleSpinBoxMaxSpeed);
188 QObject::connect(spinBoxZeroZone0, SIGNAL(valueChanged(
int)), crossW, SLOT(setZeroZone0(
int)));
189 QObject::connect(spinBoxZeroZoneX, SIGNAL(valueChanged(
int)), crossW, SLOT(setZeroZoneX(
int)));
190 QObject::connect(spinBoxZeroZoneY, SIGNAL(valueChanged(
int)), crossW, SLOT(setZeroZoneY(
int)));
191 QObject::connect(crossW, SIGNAL(zeroZone0Changed(
int)), spinBoxZeroZone0, SLOT(setValue(
int)));
192 QObject::connect(crossW, SIGNAL(zeroZoneXChanged(
int)), spinBoxZeroZoneX, SLOT(setValue(
int)));
193 QObject::connect(crossW, SIGNAL(zeroZoneYChanged(
int)), spinBoxZeroZoneY, SLOT(setValue(
int)));
195 QMetaObject::connectSlotsByName(JoystickWidgetClass);
200 JoystickWidgetClass->setWindowTitle(QApplication::translate(
"JoystickWidgetClass",
"VirtualJoystick", 0, QApplication::UnicodeUTF8));
201 groupBoxMovement->setTitle(QApplication::translate(
"JoystickWidgetClass",
"Movement", 0, QApplication::UnicodeUTF8));
202 labelSetValue->setText(QApplication::translate(
"JoystickWidgetClass",
"(0.00 / 0.00)", 0, QApplication::UnicodeUTF8));
203 labelNewText->setText(QApplication::translate(
"JoystickWidgetClass",
"New: ", 0, QApplication::UnicodeUTF8));
204 labelSetText->setText(QApplication::translate(
"JoystickWidgetClass",
"Set: ", 0, QApplication::UnicodeUTF8));
205 labelNewValue->setText(QApplication::translate(
"JoystickWidgetClass",
"(0.00 / 0.00)", 0, QApplication::UnicodeUTF8));
206 labelLeft->setText(QApplication::translate(
"JoystickWidgetClass",
"left", 0, QApplication::UnicodeUTF8));
207 labelRight->setText(QApplication::translate(
"JoystickWidgetClass",
"right", 0, QApplication::UnicodeUTF8));
208 labelZero->setText(QApplication::translate(
"JoystickWidgetClass",
"0", 0, QApplication::UnicodeUTF8));
209 groupBoxSetup->setTitle(QApplication::translate(
"JoystickWidgetClass",
"Setup", 0, QApplication::UnicodeUTF8));
210 labelZeroZoneX->setText(QApplication::translate(
"JoystickWidgetClass",
"ZeroZoneX:", 0, QApplication::UnicodeUTF8));
211 labelZeroZoneY->setText(QApplication::translate(
"JoystickWidgetClass",
"ZeroZoneY:", 0, QApplication::UnicodeUTF8));
212 labelZeroZone0->setText(QApplication::translate(
"JoystickWidgetClass",
"ZeroZone0:", 0, QApplication::UnicodeUTF8));
213 labelMaxSpeed->setText(QApplication::translate(
"JoystickWidgetClass",
"MaxSpeed:", 0, QApplication::UnicodeUTF8));
224 #endif // UI_JOYSTICKWIDGET_H