melawy-plasma-plasmoid-arch.../com.github.Melawy.ArchUpdate/contents/_toolbox/Delay.qml

16 lines
273 B
QML

import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
Item {
Timer { id: sleeper }
function exec(time, callback) {
sleeper.interval = time * 1000; // ms to s
sleeper.repeat = false;
sleeper.triggered.connect(callback);
sleeper.start();
}
}