开发者

updating list in qt creator

开发者 https://www.devze.com 2023-02-18 03:19 出处:网络
hi every one i am working on qt creator. i have a li开发者_如何学Gost which is loaded with values store in a file when i run the program. but my problem is that the file is updating continuously after

hi every one i am working on qt creator. i have a li开发者_如何学Gost which is loaded with values store in a file when i run the program. but my problem is that the file is updating continuously after 30 sec so i want to refresh my list again with new values after 30 sec. how can i do that as sleep function is not working

i want that after running my program my list get updated

thanks


example:

QTimer *reloadTimer = new QTimer(this);
connect(reloadTimer, SIGNAL(timeout()), this, SLOT(reloadTheList()));
reloadTimer->start(30000);

given a member function this.reloadTheList(), this code (eg. when run in constructor) tells the QTimer to emit timeout() every 30 seconds (30k miliseconds), which you connected to signal reloadTheList()

0

精彩评论

暂无评论...
验证码 换一张
取 消