Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [solved] Playing with time

    QML and Qt Quick
    2
    3
    1731
    Loading More Posts
    • 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
      Merinas last edited by

      Hi,

      I haven't seen any function to play with time, i wonder if is it possible. What i'm looking for is some funtions like that :
      

      @if(time1.isbefore(time2)) ...
      var intVar = time1.secTo(time2) ....@

      In a same way is there any function for handling string like find, substr or charAt ? It would prevent me from reinventing the wheel and creating a C++ extension for so few. Or at least, is it possible to create a library of functions accessible from javascript without creating QML object? Because as far as I understood it we can only register qml type.

      Thanks in advance.

      1 Reply Last reply Reply Quote 0
      • F
        frankcyblogic.de last edited by

        It's just standard EcmaScript. All standard objects are available. Take look at the "Mozilla Reference":http://developer.mozilla.org/en/JavaScript/Reference . For instance @(new Date()).getTime())@ delivers the number of miliseconds since begin of Epoch.

        1 Reply Last reply Reply Quote 0
        • M
          Merinas last edited by

          Thanks a lot. That would be great if this information was on the doc.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post