status-desktop/ui/imports/shared/controls/Timer.qml

16 lines
427 B
QML
Raw Normal View History

2020-07-06 14:15:03 +00:00
import QtQuick 2.13
Timer {
id: timer
function setTimeout(cb, delayTime) {
timer.interval = delayTime;
timer.repeat = false;
timer.triggered.connect(cb);
timer.triggered.connect(function release () {
timer.triggered.disconnect(cb); // This is important
timer.triggered.disconnect(release); // This is important as well
});
timer.start();
}
2022-02-09 09:43:23 +00:00
}