621 #if (QT_VERSION >= 0x040600) |
621 #if (QT_VERSION >= 0x040600) |
622 if (!stopAnim) |
622 if (!stopAnim) |
623 { |
623 { |
624 /**Start animation :**/ |
624 /**Start animation :**/ |
625 int coeff = 1; |
625 int coeff = 1; |
626 #ifndef Q_OS_MAC |
626 #ifdef false |
627 coeff = 2; |
627 coeff = 2; |
628 QGraphicsOpacityEffect *effectNew = new QGraphicsOpacityEffect(ui.Pages->widget(id)); |
628 QGraphicsOpacityEffect *effectNew = new QGraphicsOpacityEffect(ui.Pages->widget(id)); |
629 ui.Pages->widget(id)->setGraphicsEffect(effectNew); |
629 ui.Pages->widget(id)->setGraphicsEffect(effectNew); |
630 |
630 |
631 QGraphicsOpacityEffect *effectLast = new QGraphicsOpacityEffect(ui.Pages->widget(lastid)); |
631 QGraphicsOpacityEffect *effectLast = new QGraphicsOpacityEffect(ui.Pages->widget(lastid)); |
639 animationNewSlide->setDuration(duration); |
639 animationNewSlide->setDuration(duration); |
640 animationNewSlide->setStartValue(QPoint(width()/coeff, 0)); |
640 animationNewSlide->setStartValue(QPoint(width()/coeff, 0)); |
641 animationNewSlide->setEndValue(QPoint(0, 0)); |
641 animationNewSlide->setEndValue(QPoint(0, 0)); |
642 animationNewSlide->setEasingCurve(QEasingCurve::OutExpo); |
642 animationNewSlide->setEasingCurve(QEasingCurve::OutExpo); |
643 |
643 |
644 #ifndef Q_OS_MAC |
644 #ifdef false |
645 animationNewOpacity = new QPropertyAnimation(effectNew, "opacity"); |
645 animationNewOpacity = new QPropertyAnimation(effectNew, "opacity"); |
646 animationNewOpacity->setDuration(duration); |
646 animationNewOpacity->setDuration(duration); |
647 animationNewOpacity->setStartValue(0.01); |
647 animationNewOpacity->setStartValue(0.01); |
648 animationNewOpacity->setEndValue(1); |
648 animationNewOpacity->setEndValue(1); |
649 animationNewOpacity->setEasingCurve(QEasingCurve::OutExpo); |
649 animationNewOpacity->setEasingCurve(QEasingCurve::OutExpo); |
656 animationOldSlide->setDuration(duration); |
656 animationOldSlide->setDuration(duration); |
657 animationOldSlide->setStartValue(QPoint(0, 0)); |
657 animationOldSlide->setStartValue(QPoint(0, 0)); |
658 animationOldSlide->setEndValue(QPoint(-width()/coeff, 0)); |
658 animationOldSlide->setEndValue(QPoint(-width()/coeff, 0)); |
659 animationOldSlide->setEasingCurve(QEasingCurve::OutExpo); |
659 animationOldSlide->setEasingCurve(QEasingCurve::OutExpo); |
660 |
660 |
661 #ifndef Q_OS_MAC |
661 #ifdef false |
662 animationOldOpacity = new QPropertyAnimation(effectLast, "opacity"); |
662 animationOldOpacity = new QPropertyAnimation(effectLast, "opacity"); |
663 animationOldOpacity->setDuration(duration); |
663 animationOldOpacity->setDuration(duration); |
664 animationOldOpacity->setStartValue(1); |
664 animationOldOpacity->setStartValue(1); |
665 animationOldOpacity->setEndValue(0.01); |
665 animationOldOpacity->setEndValue(0.01); |
666 animationOldOpacity->setEasingCurve(QEasingCurve::OutExpo); |
666 animationOldOpacity->setEasingCurve(QEasingCurve::OutExpo); |
667 #endif |
667 #endif |
668 |
668 |
669 QParallelAnimationGroup *group = new QParallelAnimationGroup; |
669 QParallelAnimationGroup *group = new QParallelAnimationGroup; |
670 group->addAnimation(animationOldSlide); |
670 group->addAnimation(animationOldSlide); |
671 group->addAnimation(animationNewSlide); |
671 group->addAnimation(animationNewSlide); |
672 #ifndef Q_OS_MAC |
672 #ifdef false |
673 group->addAnimation(animationOldOpacity); |
673 group->addAnimation(animationOldOpacity); |
674 group->addAnimation(animationNewOpacity); |
674 group->addAnimation(animationNewOpacity); |
675 #endif |
675 #endif |
676 group->start(); |
676 group->start(); |
677 |
677 |
730 #if (QT_VERSION >= 0x040600) |
730 #if (QT_VERSION >= 0x040600) |
731 /**Start animation :**/ |
731 /**Start animation :**/ |
732 if (curid != 0 && !stopAnim) |
732 if (curid != 0 && !stopAnim) |
733 { |
733 { |
734 int coeff = 1; |
734 int coeff = 1; |
735 #ifndef Q_OS_MAC |
735 #ifdef false |
736 coeff = 2; |
736 coeff = 2; |
737 QGraphicsOpacityEffect *effectNew = new QGraphicsOpacityEffect(ui.Pages->widget(id)); |
737 QGraphicsOpacityEffect *effectNew = new QGraphicsOpacityEffect(ui.Pages->widget(id)); |
738 effectNew->setOpacity(1); |
738 effectNew->setOpacity(1); |
739 ui.Pages->widget(id)->setGraphicsEffect(effectNew); |
739 ui.Pages->widget(id)->setGraphicsEffect(effectNew); |
740 |
740 |
749 animationOldSlide->setDuration(duration); |
749 animationOldSlide->setDuration(duration); |
750 animationOldSlide->setStartValue(QPoint(-width()/coeff, 0)); |
750 animationOldSlide->setStartValue(QPoint(-width()/coeff, 0)); |
751 animationOldSlide->setEndValue(QPoint(0, 0)); |
751 animationOldSlide->setEndValue(QPoint(0, 0)); |
752 animationOldSlide->setEasingCurve(QEasingCurve::OutExpo); |
752 animationOldSlide->setEasingCurve(QEasingCurve::OutExpo); |
753 |
753 |
754 #ifndef Q_OS_MAC |
754 #ifdef false |
755 animationOldOpacity = new QPropertyAnimation(effectLast, "opacity"); |
755 animationOldOpacity = new QPropertyAnimation(effectLast, "opacity"); |
756 animationOldOpacity->setDuration(duration); |
756 animationOldOpacity->setDuration(duration); |
757 animationOldOpacity->setStartValue(1); |
757 animationOldOpacity->setStartValue(1); |
758 animationOldOpacity->setEndValue(0.01); |
758 animationOldOpacity->setEndValue(0.01); |
759 animationOldOpacity->setEasingCurve(QEasingCurve::OutExpo); |
759 animationOldOpacity->setEasingCurve(QEasingCurve::OutExpo); |
765 animationNewSlide->setDuration(duration); |
765 animationNewSlide->setDuration(duration); |
766 animationNewSlide->setStartValue(QPoint(0, 0)); |
766 animationNewSlide->setStartValue(QPoint(0, 0)); |
767 animationNewSlide->setEndValue(QPoint(width()/coeff, 0)); |
767 animationNewSlide->setEndValue(QPoint(width()/coeff, 0)); |
768 animationNewSlide->setEasingCurve(QEasingCurve::OutExpo); |
768 animationNewSlide->setEasingCurve(QEasingCurve::OutExpo); |
769 |
769 |
770 #ifndef Q_OS_MAC |
770 #ifdef false |
771 animationNewOpacity = new QPropertyAnimation(effectNew, "opacity"); |
771 animationNewOpacity = new QPropertyAnimation(effectNew, "opacity"); |
772 animationNewOpacity->setDuration(duration); |
772 animationNewOpacity->setDuration(duration); |
773 animationNewOpacity->setStartValue(0.01); |
773 animationNewOpacity->setStartValue(0.01); |
774 animationNewOpacity->setEndValue(1); |
774 animationNewOpacity->setEndValue(1); |
775 animationNewOpacity->setEasingCurve(QEasingCurve::OutExpo); |
775 animationNewOpacity->setEasingCurve(QEasingCurve::OutExpo); |
776 #endif |
776 #endif |
777 |
777 |
778 QParallelAnimationGroup *group = new QParallelAnimationGroup; |
778 QParallelAnimationGroup *group = new QParallelAnimationGroup; |
779 group->addAnimation(animationOldSlide); |
779 group->addAnimation(animationOldSlide); |
780 group->addAnimation(animationNewSlide); |
780 group->addAnimation(animationNewSlide); |
781 #ifndef Q_OS_MAC |
781 #ifdef false |
782 group->addAnimation(animationOldOpacity); |
782 group->addAnimation(animationOldOpacity); |
783 group->addAnimation(animationNewOpacity); |
783 group->addAnimation(animationNewOpacity); |
784 #endif |
784 #endif |
785 group->start(); |
785 group->start(); |
786 |
786 |