Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. WorkerScript and Math.random().
QtWS25 Last Chance

WorkerScript and Math.random().

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 2.0k 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
    makivioj
    wrote on last edited by
    #1

    I'm running a JavaScript code by using the WorkerScript element. In the script I use the Math.random() -function, but it doesn't work right. Math.random() should use the time as a seed, but when it's used via WorkerScript the seed and the sequence of the random numbers is always the same on different runs. Has anybody else run into this problem? Is this a bug or am I using it wrong?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mbrasser
      wrote on last edited by
      #2

      Hi,

      What version of Qt are you using? There was a general (not WorkerScript-specific) problem with random number generation prior to 4.7.2 (see http://bugreports.qt.nokia.com/browse/QTBUG-13440 for details).

      If you are using 4.7.2 or later and having this problem, I'd recommend filing a bug report for it.

      Regards,
      Michael

      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