equal
deleted
inserted
replaced
14 * |
14 * |
15 * You should have received a copy of the GNU General Public License |
15 * You should have received a copy of the GNU General Public License |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 */ |
17 */ |
18 |
18 |
19 #include <QtWidgets/QFormLayout> |
19 #include <QFormLayout> |
20 #include <QtWidgets/QLabel> |
20 #include <QLabel> |
21 #include <QtWidgets/QGridLayout> |
21 #include <QGridLayout> |
22 #include <qt5/QtCore/qobject.h> |
22 #include <QObject> |
23 |
23 |
24 #include "SimulatorWindow.h" |
24 #include "SimulatorWindow.h" |
25 |
25 |
26 Q_DECLARE_METATYPE(MotionEvent); |
26 Q_DECLARE_METATYPE(MotionEvent); |
27 Q_DECLARE_METATYPE(ButtonEvent); |
27 Q_DECLARE_METATYPE(ButtonEvent); |
93 slider->setSingleStep(1); |
93 slider->setSingleStep(1); |
94 return slider; |
94 return slider; |
95 } |
95 } |
96 |
96 |
97 void SimulatorWindow::centerAll() { |
97 void SimulatorWindow::centerAll() { |
|
98 // TODO: add option for suppressing events in sendMotionEvent() and call this method from here instead of through sliders signals, so only one event will be emitted? |
98 for (QSlider* s : motions) s->setValue(0); |
99 for (QSlider* s : motions) s->setValue(0); |
99 for (QSlider* s : rotations) s->setValue(0); |
100 for (QSlider* s : rotations) s->setValue(0); |
100 } |
101 } |
101 |
102 |
102 void SimulatorWindow::sendMotionEvent() { |
103 void SimulatorWindow::sendMotionEvent() { |