Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Random animation
Qt 6.12 LTS is out! See what's new in the release blog

Random animation

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 1.1k 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.
  • M Offline
    M Offline
    MartinD
    wrote on last edited by
    #1

    Hi,
    I want to animate property X or Y of my object and I want to change them -10 to +10 pixels from its current position (it will vibrate my object). I want to make N animations in one sequence (N = 8 to 20 and N is randomly selected at the beginning of the sequence). Every animation in the sequence must be regenerated to new random values on the sequence start.
    Can you please help with that?

    1 Reply Last reply
    0
    • LorenzL Offline
      LorenzL Offline
      Lorenz
      wrote on last edited by
      #2

      Hi,

      You can use JavaScript's Math.random() to generate random numbers in QML.

      Check out this older thread in the forum.

      Cheers,
      Lorenz

      Developer @ V-Play Engine - http://v-play.net/qt

      V-Play simplifies

      • Game Development with Qt
      • Mobile App Dev with Qt esp. iOS & Android

      What others say
      V-Play scored #1 in Cross-Platform App Development Tools Report - see why: https://goo.gl/rgp3rq

      1 Reply Last reply
      2

      • Login

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