Loop delay configuration

This commit is contained in:
Dan Paulat 2023-06-09 00:10:47 -05:00
parent a5df5a237e
commit c7a4706f43
6 changed files with 60 additions and 10 deletions

View file

@ -88,6 +88,7 @@ AnimationDockWidget::AnimationDockWidget(QWidget* parent) :
// Set loop defaults
ui->loopTimeSpinBox->setValue(30);
ui->loopSpeedSpinBox->setValue(5.0);
ui->loopDelaySpinBox->setValue(2.5);
// Connect widget signals
p->ConnectSignals();
@ -161,6 +162,15 @@ void AnimationDockWidgetImpl::ConnectSignals()
&QDoubleSpinBox::valueChanged,
self_,
[this](double d) { Q_EMIT self_->LoopSpeedChanged(d); });
QObject::connect(
self_->ui->loopDelaySpinBox,
&QDoubleSpinBox::valueChanged,
self_,
[this](double d)
{
Q_EMIT self_->LoopDelayChanged(std::chrono::milliseconds(
static_cast<typename std::chrono::milliseconds::rep>(d * 1000.0)));
});
// Animation controls
QObject::connect(self_->ui->beginButton,

View file

@ -38,6 +38,7 @@ signals:
void LoopTimeChanged(std::chrono::minutes loopTime);
void LoopSpeedChanged(double loopSpeed);
void LoopDelayChanged(std::chrono::milliseconds loopDelay);
void AnimationStepBeginSelected();
void AnimationStepBackSelected();

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>200</width>
<height>337</height>
<height>348</height>
</rect>
</property>
<property name="windowTitle">
@ -130,13 +130,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="loopTimeLabel">
<property name="text">
<string>Loop Time</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="loopTimeSpinBox">
<property name="correctionMode">
@ -156,6 +149,13 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="loopTimeLabel">
<property name="text">
<string>Loop Time</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="loopSpeedLabel">
<property name="text">
@ -179,6 +179,32 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="loopDelayLabel">
<property name="text">
<string>Loop Delay</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="loopDelaySpinBox">
<property name="suffix">
<string> sec</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="maximum">
<double>15.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>2.500000000000000</double>
</property>
</widget>
</item>
</layout>
</widget>
</item>