feat: Update WaveWidget wave time
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -45,7 +45,6 @@ public slots:
|
||||
void stopCharge();
|
||||
Q_SIGNALS:
|
||||
void valueChanged(int aValue);
|
||||
void closeSwitch();
|
||||
|
||||
private:
|
||||
QTimer* mTimer;
|
||||
|
||||
Reference in New Issue
Block a user