Ubuntu.Components.LiveTimer

A live timing source providing peridioc updates. More...

Import Statement: import Ubuntu.Components 1.3
Since: Ubuntu.Components 1.3

Properties

Signals

Detailed Description

The LiveTimer is a source for periodic signals triggered on second/minute/hour boundaries. The timer can also be set up to provide signals with an increasing frequency the closer a given time is to current time.

Examples:

import Ubuntu.Components 1.3
LiveTimer {
frequency: LiveTimer.Second
onTrigger: console.log("The time is now", new Date().toString());
}
import Ubuntu.Components 1.3
LiveTimer {
frequency: LiveTimer.Relative
relativeTime: new Date()
}

Property Documentation

frequency : enumeration

This properties defines the frequency at which the LiveTimer signals notifications.

  • LiveTimer.Disabled - disable the LiveTimer trigger signal
  • LiveTimer.Second - emit the trigger signal on every change of second.
  • LiveTimer.Minute - emit the trigger signal on every change of minute.
  • LiveTimer.Hour - emit the trigger signal on every change of hour.
  • LiveTimer.Relative - emit the trigger signal periodically depending on how close current time is to to relativeTime. If relativeTime is within 30 seconds of the current time, trigger every 30 seconds. Within an hour, trigger every minute. Otherwise, trigger every hour until the relative time is more than a week past current time, after which updates are disabled.

    Note: Setting the frequency to LiveTimer.Relative will disable the timer until a relativeTime is set.

This QML property was introduced in Ubuntu.Components 1.3.


relativeTime : datetime

This properties defines the value used for proximity evaluation when using Relative mode.

Note: This property has no impact unless the frequency is set to LiveTimer.Relative

This QML property was introduced in Ubuntu.Components 1.3.


Signal Documentation

trigger()

Signal called when the timer is triggered