How do I create a pause/wait function using Qt?

后端 未结 12 2255
执笔经年
执笔经年 2020-11-27 15:19

I\'m playing around with Qt, and I want to create a simple pause between two commands. However it won\'t seem to let me use Sleep(int mili);, and I can\'t find

12条回答
  •  孤街浪徒
    2020-11-27 16:10

    we can use following method QT_Delay:

    QTimer::singleShot(2000,this,SLOT(print_lcd()));
    

    This will wait for 2 seconds before calling print_lcd().

提交回复
热议问题