status-desktop/ui/shared/Timer.qml

15 lines
426 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();
}
}