diff --git a/src/components/WaveWidget.cpp b/src/components/WaveWidget.cpp index a59bd8a..19bfdab 100644 --- a/src/components/WaveWidget.cpp +++ b/src/components/WaveWidget.cpp @@ -227,13 +227,17 @@ void WaveWidget::stopCharge() void WaveWidget::updaterWater() { mYOffset += 0.3;//波浪偏移 - mValue += mWaveDirection * 0.025; - if (mValue >= 51 || mValue <0) + if(mWaveDirection == UpWaveDirection && mValue >48) { - mYOffset = 0; - //d->value=0; - disconnect(mTimer, &QTimer::timeout, this, &WaveWidget::updaterWater); - emit closeSwitch(); + update(); + return; } + if(mWaveDirection == DownWaveDirection && mValue <2) + { + update(); + return; + } + + mValue += mWaveDirection * 0.05; update(); } diff --git a/src/components/WaveWidget.h b/src/components/WaveWidget.h index 709e9f2..c5b84bd 100644 --- a/src/components/WaveWidget.h +++ b/src/components/WaveWidget.h @@ -45,7 +45,6 @@ public slots: void stopCharge(); Q_SIGNALS: void valueChanged(int aValue); - void closeSwitch(); private: QTimer* mTimer;