This commit is contained in:
@@ -22,7 +22,7 @@ MyCardsPixmapLabel::MyCardsPixmapLabel(QFrame* parent)
|
|||||||
|
|
||||||
isFlipside = FALSE;
|
isFlipside = FALSE;
|
||||||
|
|
||||||
timer = new QTimer;
|
fadeOutTimer = new QTimer;
|
||||||
connect(timer, SIGNAL(timeout()), this, SLOT(nextFadeOutFrame()));
|
connect(timer, SIGNAL(timeout()), this, SLOT(nextFadeOutFrame()));
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@ void MyCardsPixmapLabel::startFadeOut(int speed) {
|
|||||||
if(speed != 11) {
|
if(speed != 11) {
|
||||||
fadeOutAction = TRUE;
|
fadeOutAction = TRUE;
|
||||||
frameOpacity = 0.0;
|
frameOpacity = 0.0;
|
||||||
timer->start(40);
|
fadeOutTimer->start(40);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -54,12 +54,39 @@ void MyCardsPixmapLabel::nextFadeOutFrame() {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
timer->stop();
|
fadeOutTimer->stop();
|
||||||
fadeOutAction = FALSE;
|
fadeOutAction = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyCardsPixmapLabel::startFlipCards(int speed) {
|
||||||
|
|
||||||
|
// if(speed <= 4) { opacityRaiseIntervall = 0.01; }
|
||||||
|
// if(speed > 4 && speed <= 7) { opacityRaiseIntervall = 0.02; }
|
||||||
|
// if(speed > 7 && speed <= 10) { opacityRaiseIntervall = 0.04; }
|
||||||
|
//
|
||||||
|
// if(speed != 11) {
|
||||||
|
// fadeOutAction = TRUE;
|
||||||
|
// frameOpacity = 0.0;
|
||||||
|
// timer->start(40);
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCardsPixmapLabel::nextFlipCardsFrame() {
|
||||||
|
|
||||||
|
// if (frameOpacity < 0.65) {
|
||||||
|
// frameOpacity += opacityRaiseIntervall;
|
||||||
|
// update();
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// timer->stop();
|
||||||
|
// fadeOutAction = FALSE;
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void MyCardsPixmapLabel::setPixmap(const QPixmap &pic, const bool flipside) {
|
void MyCardsPixmapLabel::setPixmap(const QPixmap &pic, const bool flipside) {
|
||||||
|
|
||||||
QLabel::setPixmap(pic);
|
QLabel::setPixmap(pic);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public:
|
|||||||
bool getIsFlipside() const{ return isFlipside;}
|
bool getIsFlipside() const{ return isFlipside;}
|
||||||
|
|
||||||
void startFadeOut(int);
|
void startFadeOut(int);
|
||||||
|
void startFlipCards(int);
|
||||||
|
|
||||||
void paintEvent(QPaintEvent * event);
|
void paintEvent(QPaintEvent * event);
|
||||||
|
|
||||||
@@ -37,12 +38,14 @@ public slots:
|
|||||||
|
|
||||||
void setPixmap ( const QPixmap &, const bool );
|
void setPixmap ( const QPixmap &, const bool );
|
||||||
void nextFadeOutFrame();
|
void nextFadeOutFrame();
|
||||||
|
void nextFlipCardsFrame();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
qreal frameOpacity;
|
qreal frameOpacity;
|
||||||
qreal opacityRaiseIntervall;
|
qreal opacityRaiseIntervall;
|
||||||
QTimer *timer;
|
QTimer *fadeOutTimer;
|
||||||
|
QTimer *flipCardsTimer;
|
||||||
|
|
||||||
bool isFlipside;
|
bool isFlipside;
|
||||||
bool fadeOutAction;
|
bool fadeOutAction;
|
||||||
|
|||||||
Reference in New Issue
Block a user