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. On Long Run QML Timer stops after 536870 iterations of 1 sec each

On Long Run QML Timer stops after 536870 iterations of 1 sec each

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 3 Posters 829 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.
  • C Offline
    C Offline
    ChetanSuri
    wrote on last edited by
    #1

    Hi All,
    I'm developing a application and expect it to run for 10 days continuously. but the animation & timer in my application comes to an abrupt halt after 536870 iteration's of 1 second each. This translates to approximately 5 days 19 hours & 13 Mins.

    after doing some research on google :), noticed that this number when translated to milli seconds
    536870 x 1000 = 536870000 (decimal) == approximately 0x20000000 (Hex)

    also noticed on
    http://fluxer.github.io/katana/d7/dee/classCalendarSystem.html
    &
    https://community.kde.org/Plasma/Locale
    QML Bindings for KLocale has a reference like UnixTime = 0x20000000

    example app

    import QtQuick 2.4
    import QtQuick.Window 2.2

    Item {
        id: mainWindow
        objectName: "testapp"
        width: 640
        height: 480
        visible: true
        property int count: 0
    
        Timer{
            id: testTimer
            interval: 1000
            repeat: true
            running: true
            onTriggered: {
                count++;
                console.log(" count is "+count);
            }
        }
    
        Rectangle {
            id: rotatingBox
            width: 100
            height: 100
            x: 200
            y: 200
            color: "red"
            RotationAnimator {
                target: rotatingBox;
                from: 0;
                to: 360;
                duration: 1000
                running: true
                loops: Animation.Infinite
            }
    
        }
    
    }
    

    If this issue rings bell to any body, your inputs are appreciated.

    Thanks in Advance,
    CS

    1 Reply Last reply
    0
    • fcarneyF Offline
      fcarneyF Offline
      fcarney
      wrote on last edited by fcarney
      #2

      @ChetanSuri said in On Long Run QML Timer stops after 536870 iterations of 1 sec each:

      10 days continuously

      Why not use a date time function to check start date and time and end when ten days have passed? Essentially the date time functions in your computer are already running a timer for you. You could even have it start the process at a specific time so after 10 days you know it will be done by 8am Monday for example. If your computer is synced to an external time source then you know that 10 days will be accurate as well.

      Looking at the code I don't see any reason why it would halt. Does the program quit or the timer stops firing? Or is the text buffer for the console.log message full? Try logging to a file maybe (might have to write c++ code for that).

      C++ is a perfectly valid school of magic.

      C 1 Reply Last reply
      3
      • fcarneyF fcarney

        @ChetanSuri said in On Long Run QML Timer stops after 536870 iterations of 1 sec each:

        10 days continuously

        Why not use a date time function to check start date and time and end when ten days have passed? Essentially the date time functions in your computer are already running a timer for you. You could even have it start the process at a specific time so after 10 days you know it will be done by 8am Monday for example. If your computer is synced to an external time source then you know that 10 days will be accurate as well.

        Looking at the code I don't see any reason why it would halt. Does the program quit or the timer stops firing? Or is the text buffer for the console.log message full? Try logging to a file maybe (might have to write c++ code for that).

        C Offline
        C Offline
        ChetanSuri
        wrote on last edited by ChetanSuri
        #3

        @fcarney
        The program doe not quit but The timer stops firing.
        one thing that I have noticed is that if an event handler for key presses is added, it accepts the incoming keys. which means that the application is still active.

        between I am having the problem on version 5.4.3

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sbachann
          wrote on last edited by
          #4

          Seems to be 29 bit overflow (0x1fffffff (536870911)). Not sure if it's a bug in timers.

          1 Reply Last reply
          0
          • C Offline
            C Offline
            ChetanSuri
            wrote on last edited by
            #5

            This issue has been fixed in
            https://bugreports.qt.io/browse/QTBUG-45358

            closing this issue

            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 Extensions
            • Unsolved