Results 1 to 2 of 2

Thread: Qt5/C++ - QEasingCurve, change bounce height

  1. #1
    Join Date
    Oct 2006
    Posts
    105
    Thanks
    13
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Qt5/C++ - QEasingCurve, change bounce height

    Qt 5.60

    Hello,

    Trying to change the bounce height of an easing curve.
    Even with a value of zero, the bounce always looks the same.
    What am I doing wrong?

    Regards

    From the help system:-
    void QEasingCurve::setOvershoot(qreal overshoot)
    Sets the overshoot to overshoot.
    0 produces no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent.
    Qt Code:
    1. qreal overshoot = 1.7; // 0.0
    2. QEasingCurve easing = (QEasingCurve::OutElastic);
    3. QPropertyAnimation *animation[qty];
    4. for (uint i = 0; i < qty; i++)
    5. {
    6. animation[i] = new QPropertyAnimation(numLabel[i], "geometry");
    7. animation[i]->setDuration(1500);
    8.  
    9. easing.setOvershoot(overshoot);
    10. //easing.setAmplitude(overshoot);
    11.  
    12. animation[i]->setEasingCurve(easing);
    13.  
    14. animation[i]->setStartValue(QRect(-2, -86, 100, 80));
    15. animation[i]->setEndValue(QRect(-2, -2, 100, 80));
    16. }
    17.  
    18. for (uint i = 0; i < qty; i++)
    19. {
    20. animation[i]->start();
    21. tDelay(300); // milliSecs
    22. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by jimbo; 20th June 2016 at 18:08.

  2. #2
    Join Date
    Oct 2006
    Posts
    105
    Thanks
    13
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt5/C++ - QEasingCurve, change bounce height [Solved]

    Hello,

    It appears you need to change both Amplitude and Period to get any change,
    and play with the values to get the effect you want.
    Qt Code:
    1. //easing.setOvershoot(overshoot);
    2. easing.setAmplitude(amplitude);
    3. easing.setPeriod(period);
    To copy to clipboard, switch view to plain text mode 
    Regards

Similar Threads

  1. how to change the height of QHeaderView?
    By TorAn in forum Qt Programming
    Replies: 1
    Last Post: 13th March 2015, 08:43
  2. Change height of QTabbar in QTabWidget
    By posixprogrammer in forum Newbie
    Replies: 1
    Last Post: 25th April 2011, 15:23
  3. QEasingCurve how to get progress for value?
    By Mechan in forum Qt Programming
    Replies: 0
    Last Post: 14th August 2010, 22:57
  4. QTableView How to change height for all rows?
    By sergey_85 in forum Qt Programming
    Replies: 2
    Last Post: 1st December 2009, 19:49
  5. updateEditorGeometry() and height change
    By Lykurg in forum Qt Programming
    Replies: 1
    Last Post: 1st October 2008, 20:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.