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. QPropertyAnimation
Forum Update on Monday, May 27th 2025

QPropertyAnimation

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.6k Views
  • 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.
  • G Offline
    G Offline
    great88
    wrote on 25 Oct 2013, 02:27 last edited by
    #1

    I am using a small animation on my widget window ... so I am moving a particle from one
    coordinate to another using QPropertyAnimation::setStartValue and setEndValue .

    The problem I have come across is when I resize the window the particle size needs to change and the end value needs to change otherwise the animation doesn't do the right thing .

    So far I have tried to just stop the animation using a signal from the resize-event and move the particle directly to the end value . Is there any other more elegant solution ? I have seen applications that just don't do anything while the window is being resized ; the window contents just become static while resizing ( and during any socket activity as well ) and the end result is shown only when resizing is stopped . This would be an acceptable solution for me but I am not sure how that is achieved .

    1 Reply Last reply
    0
    • N Offline
      N Offline
      NicuPopescu
      wrote on 25 Oct 2013, 09:45 last edited by
      #2

      Hi,

      I can only give you a rough idea on what I think ti should be done:

      1. define a scale factor = max_window_size/current_window_size (i.e. for size property animation there would be two factors for height and width); so, if for instance current_window_size = max_window_size then factor = 1.0, otherwise factor < 1.0 for all other current values

      *max_window_size is arbitrary chosen(normally is the maximized size but not necessarily ) must be kept always as a reference

      1. adjust the starting size of your particle according to the starting scale factor which depends on the starting size of the window

      2. when resizing event occurs stop the animation and readjust the currentValue and endValue multiplying them by the scale factor, then start the animation ; resize the particle in the same way currentSize*scaleFactor

      hope it enlighten a little! :)

      Cheers!

      1 Reply Last reply
      0
      • G Offline
        G Offline
        great88
        wrote on 25 Oct 2013, 17:41 last edited by
        #3

        Yeah , I know , I have tried stuff like that couple months ago . I don't remember the exact result except that it dIdn't work . The animation doesn't like to be stopped and restarted or something . I might try it again but if anybody knows anything else , let me know .

        1 Reply Last reply
        0
        • G Offline
          G Offline
          great88
          wrote on 8 Nov 2013, 00:29 last edited by
          #4

          I am actually having the problem where if you resize the window continuously before the animation starts , the animation doesn't start . It is like the animation is blocked by the resize event even though I put it in its own thread , The animation is animating widgets within the window .

          Any solution ?

          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