timeout with boost-timer
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
MySetLabel::MySetLabel(QGroupBox* parent)
|
MySetLabel::MySetLabel(QGroupBox* parent)
|
||||||
: QLabel(parent), timeOutAnimation(FALSE), timeOutValue(0), timeOutFrame(0), waitFrames(0), decreaseWidthIntervall(1), timerIntervall(0)
|
: QLabel(parent), timeOutAnimation(FALSE), timeOutValue(0), timeOutFrame(0), waitFrames(0), timerIntervall(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
timeOutAnimationTimer = new QTimer;
|
timeOutAnimationTimer = new QTimer;
|
||||||
@@ -31,8 +31,6 @@ MySetLabel::~MySetLabel()
|
|||||||
|
|
||||||
void MySetLabel::startTimeOutAnimation(int secs) {
|
void MySetLabel::startTimeOutAnimation(int secs) {
|
||||||
|
|
||||||
decreaseWidthIntervall = 1;
|
|
||||||
|
|
||||||
timeOutValue = secs;
|
timeOutValue = secs;
|
||||||
timeOutFrame = 1;
|
timeOutFrame = 1;
|
||||||
timeOutAnimationWidth = 118;
|
timeOutAnimationWidth = 118;
|
||||||
@@ -50,7 +48,6 @@ void MySetLabel::startTimeOutAnimation(int secs) {
|
|||||||
else {
|
else {
|
||||||
timerIntervall = timerIntervall + preTimerIntervall;
|
timerIntervall = timerIntervall + preTimerIntervall;
|
||||||
}
|
}
|
||||||
decreaseWidthIntervall++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
waitFrames = 3000/timerIntervall;
|
waitFrames = 3000/timerIntervall;
|
||||||
@@ -84,7 +81,6 @@ void MySetLabel::nextTimeOutAnimationFrame() {
|
|||||||
if(timeOutAnimationWidth >=0) {
|
if(timeOutAnimationWidth >=0) {
|
||||||
if(timeOutFrame > waitFrames) {
|
if(timeOutFrame > waitFrames) {
|
||||||
//save gfx ressources and never play more the 10 pps
|
//save gfx ressources and never play more the 10 pps
|
||||||
// timeOutAnimationWidth = timeOutAnimationWidth - decreaseWidthIntervall;
|
|
||||||
unsigned int realTimerValue = realTimer.elapsed().total_milliseconds();
|
unsigned int realTimerValue = realTimer.elapsed().total_milliseconds();
|
||||||
timeOutAnimationWidth = 118-(((realTimerValue-3000)*118)/((timeOutValue-3)*1000));
|
timeOutAnimationWidth = 118-(((realTimerValue-3000)*118)/((timeOutValue-3)*1000));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user