feat: Update WaveWidget wave time
This commit is contained in:
@@ -227,13 +227,17 @@ void WaveWidget::stopCharge()
|
|||||||
void WaveWidget::updaterWater()
|
void WaveWidget::updaterWater()
|
||||||
{
|
{
|
||||||
mYOffset += 0.3;//波浪偏移
|
mYOffset += 0.3;//波浪偏移
|
||||||
mValue += mWaveDirection * 0.025;
|
if(mWaveDirection == UpWaveDirection && mValue >48)
|
||||||
if (mValue >= 51 || mValue <0)
|
|
||||||
{
|
{
|
||||||
mYOffset = 0;
|
update();
|
||||||
//d->value=0;
|
return;
|
||||||
disconnect(mTimer, &QTimer::timeout, this, &WaveWidget::updaterWater);
|
|
||||||
emit closeSwitch();
|
|
||||||
}
|
}
|
||||||
|
if(mWaveDirection == DownWaveDirection && mValue <2)
|
||||||
|
{
|
||||||
|
update();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mValue += mWaveDirection * 0.05;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ public slots:
|
|||||||
void stopCharge();
|
void stopCharge();
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void valueChanged(int aValue);
|
void valueChanged(int aValue);
|
||||||
void closeSwitch();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTimer* mTimer;
|
QTimer* mTimer;
|
||||||
|
|||||||
Reference in New Issue
Block a user