QTfrontend/hwform.cpp
changeset 6442 e6e409d9d6db
parent 6440 1fa9dc94c93f
child 6476 afb7ef0c1c6e
equal deleted inserted replaced
6441:9e5a3b2a3c38 6442:e6e409d9d6db
   560 
   560 
   561     if (frontendEffects && !stopAnim)
   561     if (frontendEffects && !stopAnim)
   562     {
   562     {
   563         /**Start animation :**/
   563         /**Start animation :**/
   564         int coeff = 1;
   564         int coeff = 1;
   565 #ifdef Q_OS_LINUX
   565 #ifndef Q_OS_OSX
   566         coeff = 2;
   566         coeff = 2;
   567         QGraphicsOpacityEffect *effectNew = new QGraphicsOpacityEffect(ui.Pages->widget(id));
   567         QGraphicsOpacityEffect *effectNew = new QGraphicsOpacityEffect(ui.Pages->widget(id));
   568         ui.Pages->widget(id)->setGraphicsEffect(effectNew);
   568         ui.Pages->widget(id)->setGraphicsEffect(effectNew);
   569 
   569 
   570         QGraphicsOpacityEffect *effectLast = new QGraphicsOpacityEffect(ui.Pages->widget(lastid));
   570         QGraphicsOpacityEffect *effectLast = new QGraphicsOpacityEffect(ui.Pages->widget(lastid));
   576         animationNewSlide->setDuration(500);
   576         animationNewSlide->setDuration(500);
   577         animationNewSlide->setStartValue(QPoint(width()/coeff, 0));
   577         animationNewSlide->setStartValue(QPoint(width()/coeff, 0));
   578         animationNewSlide->setEndValue(QPoint(0, 0));
   578         animationNewSlide->setEndValue(QPoint(0, 0));
   579         animationNewSlide->setEasingCurve(QEasingCurve::OutExpo);
   579         animationNewSlide->setEasingCurve(QEasingCurve::OutExpo);
   580 
   580 
   581 #ifdef Q_OS_LINUX
   581 #ifndef Q_OS_OSX
   582         animationNewOpacity = new QPropertyAnimation(effectNew, "opacity");
   582         animationNewOpacity = new QPropertyAnimation(effectNew, "opacity");
   583         animationNewOpacity->setDuration(500);
   583         animationNewOpacity->setDuration(500);
   584         animationNewOpacity->setStartValue(0.01);
   584         animationNewOpacity->setStartValue(0.01);
   585         animationNewOpacity->setEndValue(1);
   585         animationNewOpacity->setEndValue(1);
   586         animationNewOpacity->setEasingCurve(QEasingCurve::OutExpo);
   586         animationNewOpacity->setEasingCurve(QEasingCurve::OutExpo);
   593         animationOldSlide->setDuration(500);
   593         animationOldSlide->setDuration(500);
   594         animationOldSlide->setStartValue(QPoint(0, 0));
   594         animationOldSlide->setStartValue(QPoint(0, 0));
   595         animationOldSlide->setEndValue(QPoint(-width()/coeff, 0));
   595         animationOldSlide->setEndValue(QPoint(-width()/coeff, 0));
   596         animationOldSlide->setEasingCurve(QEasingCurve::OutExpo);
   596         animationOldSlide->setEasingCurve(QEasingCurve::OutExpo);
   597 
   597 
   598 #ifdef Q_OS_LINUX
   598 #ifndef Q_OS_OSX
   599         animationOldOpacity = new QPropertyAnimation(effectLast, "opacity");
   599         animationOldOpacity = new QPropertyAnimation(effectLast, "opacity");
   600         animationOldOpacity->setDuration(500);
   600         animationOldOpacity->setDuration(500);
   601         animationOldOpacity->setStartValue(1);
   601         animationOldOpacity->setStartValue(1);
   602         animationOldOpacity->setEndValue(0.01);
   602         animationOldOpacity->setEndValue(0.01);
   603         animationOldOpacity->setEasingCurve(QEasingCurve::OutExpo);
   603         animationOldOpacity->setEasingCurve(QEasingCurve::OutExpo);
   604 #endif
   604 #endif
   605 
   605 
   606         QParallelAnimationGroup *group = new QParallelAnimationGroup;
   606         QParallelAnimationGroup *group = new QParallelAnimationGroup;
   607         group->addAnimation(animationOldSlide);
   607         group->addAnimation(animationOldSlide);
   608         group->addAnimation(animationNewSlide);
   608         group->addAnimation(animationNewSlide);
   609 #ifdef Q_OS_LINUX
   609 #ifndef Q_OS_OSX
   610         group->addAnimation(animationOldOpacity);
   610         group->addAnimation(animationOldOpacity);
   611         group->addAnimation(animationNewOpacity);
   611         group->addAnimation(animationNewOpacity);
   612 #endif
   612 #endif
   613         group->start();
   613         group->start();
   614 
   614 
   666     /**Start animation :**/
   666     /**Start animation :**/
   667 
   667 
   668     if (curid != 0 && frontendEffects && !stopAnim)
   668     if (curid != 0 && frontendEffects && !stopAnim)
   669     {
   669     {
   670         int coeff = 1;
   670         int coeff = 1;
   671 #ifdef Q_OS_LINUX
   671 #ifndef Q_OS_OSX
   672         coeff = 2;
   672         coeff = 2;
   673         QGraphicsOpacityEffect *effectNew = new QGraphicsOpacityEffect(ui.Pages->widget(id));
   673         QGraphicsOpacityEffect *effectNew = new QGraphicsOpacityEffect(ui.Pages->widget(id));
   674         effectNew->setOpacity(1);
   674         effectNew->setOpacity(1);
   675         ui.Pages->widget(id)->setGraphicsEffect(effectNew);
   675         ui.Pages->widget(id)->setGraphicsEffect(effectNew);
   676 
   676 
   683         animationOldSlide->setDuration(500);
   683         animationOldSlide->setDuration(500);
   684         animationOldSlide->setStartValue(QPoint(-width()/coeff, 0));
   684         animationOldSlide->setStartValue(QPoint(-width()/coeff, 0));
   685         animationOldSlide->setEndValue(QPoint(0, 0));
   685         animationOldSlide->setEndValue(QPoint(0, 0));
   686         animationOldSlide->setEasingCurve(QEasingCurve::OutExpo);
   686         animationOldSlide->setEasingCurve(QEasingCurve::OutExpo);
   687 
   687 
   688 #ifdef Q_OS_LINUX
   688 #ifndef Q_OS_OSX
   689         animationOldOpacity = new QPropertyAnimation(effectLast, "opacity");
   689         animationOldOpacity = new QPropertyAnimation(effectLast, "opacity");
   690         animationOldOpacity->setDuration(500);
   690         animationOldOpacity->setDuration(500);
   691         animationOldOpacity->setStartValue(1);
   691         animationOldOpacity->setStartValue(1);
   692         animationOldOpacity->setEndValue(0.01);
   692         animationOldOpacity->setEndValue(0.01);
   693         animationOldOpacity->setEasingCurve(QEasingCurve::OutExpo);
   693         animationOldOpacity->setEasingCurve(QEasingCurve::OutExpo);
   699         animationNewSlide->setDuration(500);
   699         animationNewSlide->setDuration(500);
   700         animationNewSlide->setStartValue(QPoint(0, 0));
   700         animationNewSlide->setStartValue(QPoint(0, 0));
   701         animationNewSlide->setEndValue(QPoint(width()/coeff, 0));
   701         animationNewSlide->setEndValue(QPoint(width()/coeff, 0));
   702         animationNewSlide->setEasingCurve(QEasingCurve::OutExpo);
   702         animationNewSlide->setEasingCurve(QEasingCurve::OutExpo);
   703 
   703 
   704 #ifdef Q_OS_LINUX
   704 #ifndef Q_OS_OSX
   705         animationNewOpacity = new QPropertyAnimation(effectNew, "opacity");
   705         animationNewOpacity = new QPropertyAnimation(effectNew, "opacity");
   706         animationNewOpacity->setDuration(500);
   706         animationNewOpacity->setDuration(500);
   707         animationNewOpacity->setStartValue(0.01);
   707         animationNewOpacity->setStartValue(0.01);
   708         animationNewOpacity->setEndValue(1);
   708         animationNewOpacity->setEndValue(1);
   709         animationNewOpacity->setEasingCurve(QEasingCurve::OutExpo);
   709         animationNewOpacity->setEasingCurve(QEasingCurve::OutExpo);
   710 #endif
   710 #endif
   711 
   711 
   712         QParallelAnimationGroup *group = new QParallelAnimationGroup;
   712         QParallelAnimationGroup *group = new QParallelAnimationGroup;
   713         group->addAnimation(animationOldSlide);
   713         group->addAnimation(animationOldSlide);
   714         group->addAnimation(animationNewSlide);
   714         group->addAnimation(animationNewSlide);
   715 #ifdef Q_OS_LINUX
   715 #ifndef Q_OS_OSX
   716         group->addAnimation(animationOldOpacity);
   716         group->addAnimation(animationOldOpacity);
   717         group->addAnimation(animationNewOpacity);
   717         group->addAnimation(animationNewOpacity);
   718 #endif
   718 #endif
   719         group->start();
   719         group->start();
   720 
   720