Commit e33447ae authored by Emmanuel Promayon's avatar Emmanuel Promayon

NEW change translation GUI (now a slider)

parent 7aeb1912
......@@ -39,6 +39,7 @@ AnglesSetterWidget::AnglesSetterWidget(SetAnglesAction* a, QWidget* parent): QWi
// Ui slice number change slot connection
connect(ui.translationSpinBox, SIGNAL(valueChanged(double)), this, SLOT(translationSpinBoxChanged(double)));
connect(ui.translationSlider, SIGNAL(valueChanged(int)), this, SLOT(translationSliderChanged(int)));
// Ui angles slot connection
connect(ui.xAngleDial, SIGNAL(valueChanged(int)), this, SLOT(xAngleDialValueChanged(int)));
......@@ -56,12 +57,11 @@ AnglesSetterWidget::~AnglesSetterWidget() {
// -------------------- updateGUI --------------------
void AnglesSetterWidget::updateGUI() {
ui.translationSpinBox->blockSignals(true);
ui.upButton->blockSignals(true);
ui.downButton->blockSignals(true);
ui.translationSlider->blockSignals(true);
ui.translationSpinBox->setValue(myAction->property("Translation").toDouble());
ui.translationSlider->setValue(myAction->property("Translation").toDouble()*10);
ui.translationSpinBox->blockSignals(false);
ui.upButton->blockSignals(false);
ui.downButton->blockSignals(false);
ui.translationSlider->blockSignals(false);
ui.xAngleDial->blockSignals(true);
ui.xAngleDial->setValue(myAction->property("X Angle").toInt());
......@@ -94,6 +94,12 @@ void AnglesSetterWidget::translationSpinBoxChanged(double value) {
myAction->setProperty("Translation", value);
}
// -------------------- translationSliderChanged --------------------
void AnglesSetterWidget::translationSliderChanged(int value) {
// the slide is from 0 to 1000
myAction->setProperty("Translation", value/10);
}
// -------------------- xAngleDialValueChanged --------------------
void AnglesSetterWidget::xAngleDialValueChanged(int value) {
myAction->setProperty("X Angle", value);
......
......@@ -60,6 +60,7 @@ private slots:
/// Update the translation value
void translationSpinBoxChanged(double);
void translationSliderChanged(int);
/// Method that update the angle dialog slider (text + value)
void xAngleDialValueChanged(int);
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>424</width>
<width>391</width>
<height>311</height>
</rect>
</property>
......@@ -42,35 +42,35 @@
<rect>
<x>0</x>
<y>0</y>
<width>408</width>
<width>375</width>
<height>295</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="translationLayout">
<item>
<widget class="QLabel" name="translationLabel">
<property name="text">
<string>Translation</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="downButton">
<property name="text">
<string></string>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="autoRepeat">
<bool>true</bool>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
<property name="autoRepeatInterval">
<number>5</number>
</spacer>
</item>
<item>
<widget class="QLabel" name="translationLabel">
<property name="text">
<string>Translation</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
......@@ -86,7 +86,7 @@
<set>Qt::AlignCenter</set>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
<enum>QAbstractSpinBox::UpDownArrows</enum>
</property>
<property name="accelerated">
<bool>true</bool>
......@@ -115,20 +115,54 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="upButton">
<property name="text">
<string></string>
</property>
<property name="autoRepeat">
<bool>true</bool>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="autoRepeatInterval">
<number>5</number>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</widget>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QSlider" name="translationSlider">
<property name="cursor">
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Translation offset (percent)</string>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="maximum">
<number>1000</number>
</property>
<property name="value">
<number>500</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="tickPosition">
<enum>QSlider::TicksAbove</enum>
</property>
<property name="tickInterval">
<number>50</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
......@@ -301,43 +335,7 @@
<tabstop>xAngleDial</tabstop>
<tabstop>yAngleDial</tabstop>
<tabstop>zAngleDial</tabstop>
<tabstop>downButton</tabstop>
<tabstop>translationSpinBox</tabstop>
<tabstop>upButton</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>downButton</sender>
<signal>clicked()</signal>
<receiver>translationSpinBox</receiver>
<slot>stepUp()</slot>
<hints>
<hint type="sourcelabel">
<x>66</x>
<y>451</y>
</hint>
<hint type="destinationlabel">
<x>116</x>
<y>450</y>
</hint>
</hints>
</connection>
<connection>
<sender>upButton</sender>
<signal>clicked()</signal>
<receiver>translationSpinBox</receiver>
<slot>stepDown()</slot>
<hints>
<hint type="sourcelabel">
<x>235</x>
<y>446</y>
</hint>
<hint type="destinationlabel">
<x>169</x>
<y>440</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment