Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Need to call repaint during animation

Need to call repaint during animation

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 3.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TheClassic
    wrote on last edited by
    #1

    Something I'm doing with an animation (QPropertyAnimation) causes an artifact that can be resolved by calling repaint for the region. However a) I don't know when the animation is complete and b) I'd like to call repaint for each step of the animation. Can anybody point me in the right direction as far as what I need to be able to do in order to be able to call repaint during an animation? Thanks

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kkrzewniak
      wrote on last edited by
      #2

      If you have direct access to the code of the class of objects you animate with QPropertyAnimation, it would be possible to call repaint in the properties write method. However I'd have a better look and try to find out why the artifacts are there (maybe an incorrect bounding rect if you are dealing with QGraphicsObjects?)

      Me, Grimlock, not "nice dino". ME BASH BRAINS!

      1 Reply Last reply
      0
      • T Offline
        T Offline
        TheClassic
        wrote on last edited by
        #3

        Thanks your suggestion worked.

        I initially tried to override setMinimumHeight for my class that inherits QWidget so that I could call repaint from it after calling QWidget::setMinimumHeight. The minimum height is one of the properties I'm animating. However, my override was never called. I'm guessing the way the property animation works breaks any attempt of using polymorphism (or did I do something wrong implementing my override?). I ended up just adding a property to my class for the purpose of repainting and used animation groups.

        The artifact is caused by the following:
        I added the ability to collapse dockwidgets. (Imagine dock widgets docked to the left side. There is a button in the title bar to make them 0 height. This collapse is animated). Consider having two widgets docked to the left side. If you collapse the bottom one, the top one grows to fill the space. If you then collapse the top one, the titlebar for the bottom widget moves as the top widget shrinks. Its splitter leaves artifacts in the empty space below the titlebars. see http://i.imgur.com/xLaUE.png I think this is just a limitation of Qt.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kkrzewniak
          wrote on last edited by
          #4

          setMinimumHeight is a non virtual method so overriding it will not do.

          Me, Grimlock, not "nice dino". ME BASH BRAINS!

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved