Results 1 to 4 of 4

Thread: update problem

  1. #1
    Join Date
    Apr 2012
    Posts
    101
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default update problem

    Hi
    i use qt+ogre
    and i make animation to my object
    it work good
    but i have problem in update
    when i clic on the window or i clic on dockwidget
    it stop animation, but it start when i move the mouse only
    (if i stop the moving of mouse the animation stop too)
    that's my code
    Qt Code:
    1. void OgreWidget::paintEvent(QPaintEvent *e)
    2. {
    3.  
    4. ogreRoot->_fireFrameStarted();
    5.  
    6. ogreRoot->_fireFrameRenderingQueued();
    7.  
    8. ogreRenderWindow->update();
    9. ogreRoot->_fireFrameEnded();
    10. number_frame=number_frame+10;
    11.  
    12. if(number_frame<framme.size())
    13. animation1();
    14. ogreRenderWindow->update();
    15. animation2();
    16. ogreRenderWindow->update();
    17.  
    18. e->accept();
    19. ogreRenderWindow->update();
    20. //update();
    21. }
    To copy to clipboard, switch view to plain text mode 
    if i do not delete "update()" it show/delete/show/delete.....(paint and repaint ) the scene

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: update problem

    animation should not be 'hard coded' in paint event because you do not know how often pain event will be called.


    try these instead
    http://qt-project.org/doc/qt-4.8/qtimeline.html
    http://doc.trolltech.com/solutions/4...animation.html
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Apr 2012
    Posts
    101
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: update problem

    thanks for repling
    i do not use timer to animate
    it's not traditionnal animation
    her i have the number of frame and the position of the objects in each frame,
    i tried to put it an void out the paint and call it it dos not work

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: update problem

    and thats why you should look at
    http://qt-project.org/doc/qt-4.8/qtimeline.html

    you shouldnt be updating frame number in paint event
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Form update problem
    By thefatladysingsopera in forum Newbie
    Replies: 9
    Last Post: 13th September 2011, 09:56
  2. QTableWidget update problem
    By mammenj in forum Qt Programming
    Replies: 2
    Last Post: 13th August 2010, 07:46
  3. qListWidget nad update problem
    By Talei in forum Newbie
    Replies: 4
    Last Post: 2nd April 2010, 11:05
  4. QSlider Update Problem
    By December in forum Qt Programming
    Replies: 4
    Last Post: 10th September 2006, 05:02
  5. View update problem
    By prakash in forum Qt Programming
    Replies: 6
    Last Post: 17th March 2006, 11:13

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.