From 060f6a4abf60444fd45ec08a71f4ce95b7555883 Mon Sep 17 00:00:00 2001 From: Treeki Date: Sat, 18 Aug 2012 04:40:06 +0200 Subject: sorted out ranges and steps and crap for the SRT spinboxes --- lspaneeditor.cpp | 21 +++++++++++---------- lspaneeditor.h | 16 +++++++++++++--- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/lspaneeditor.cpp b/lspaneeditor.cpp index ee7e310..e63cb4f 100644 --- a/lspaneeditor.cpp +++ b/lspaneeditor.cpp @@ -86,10 +86,10 @@ void LSPaneEditor::createPaneTab() { gLayout = new QGridLayout(geoBox); m_width = new QDoubleSpinBox(geoBox); - m_width->setRange(0.0, 100000.0); + m_width->setRange(-100000.0, 100000.0); connect(m_width, SIGNAL(valueChanged(double)), SLOT(handleWidthChanged(double))); m_height = new QDoubleSpinBox(geoBox); - m_height->setRange(0.0, 100000.0); + m_height->setRange(-100000.0, 100000.0); connect(m_height, SIGNAL(valueChanged(double)), SLOT(handleHeightChanged(double))); m_horzOrigin = new QComboBox(geoBox); @@ -130,14 +130,15 @@ void LSPaneEditor::createPaneTab() { QGroupBox *posBox = new QGroupBox("Positioning", m_paneTab); gLayout = new QGridLayout(posBox); - m_transX = new QDoubleSpinBox(posBox); - m_transY = new QDoubleSpinBox(posBox); - m_transZ = new QDoubleSpinBox(posBox); - m_rotX = new QDoubleSpinBox(posBox); - m_rotY = new QDoubleSpinBox(posBox); - m_rotZ = new QDoubleSpinBox(posBox); - m_scaleX = new QDoubleSpinBox(posBox); - m_scaleY = new QDoubleSpinBox(posBox); + for (int i = 0; i < 8; i++) { + m_transSpinBoxes[i] = new QDoubleSpinBox(posBox); + m_transSpinBoxes[i]->setDecimals(3); + m_transSpinBoxes[i]->setRange(-100000.0, 100000.0); + } + + for (int i = 0; i < 3; i++) { + m_rotSpinBoxes[i]->setSingleStep(10.0); + } connect(m_transX, SIGNAL(valueChanged(double)), SLOT(handleTransXChanged(double))); connect(m_transY, SIGNAL(valueChanged(double)), SLOT(handleTransYChanged(double))); diff --git a/lspaneeditor.h b/lspaneeditor.h index 22a7a7d..9aaf942 100644 --- a/lspaneeditor.h +++ b/lspaneeditor.h @@ -38,9 +38,19 @@ private: QComboBox *m_horzOrigin, *m_vertOrigin; QCheckBox *m_widescreen; //, *m_visible; - QDoubleSpinBox *m_transX, *m_transY, *m_transZ; - QDoubleSpinBox *m_rotX, *m_rotY, *m_rotZ; - QDoubleSpinBox *m_scaleX, *m_scaleY; + union { + QDoubleSpinBox *m_srtSpinBoxes[8]; + struct { + QDoubleSpinBox *m_transSpinBoxes[3]; + QDoubleSpinBox *m_rotSpinBoxes[3]; + QDoubleSpinBox *m_scaleSpinBoxes[2]; + }; + struct { + QDoubleSpinBox *m_transX, *m_transY, *m_transZ; + QDoubleSpinBox *m_rotX, *m_rotY, *m_rotZ; + QDoubleSpinBox *m_scaleX, *m_scaleY; + }; + }; void createPaneTab(); -- cgit v1.2.3