How to create delay function in QML?

前端 未结 5 606
小鲜肉
小鲜肉 2020-12-23 21:17

I would like to create a delay function in javascript that takes a parameter of amount of time to delay, so that I could use it do introduce delay between execution of javas

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-23 21:29

    you can use QtTest

    import QtTest 1.0
    import QtQuick 2.9
    
    ApplicationWindow{
        id: window
    
        TestEvent {
            id: test
        }
    
        function delay_ms(delay_time) {
            test.mouseClick(window, 0, 0, Qt.NoButton, Qt.NoModifier, delay_time)
        }
    }
    

提交回复
热议问题