简体   繁体   中英

updating list in qt creator

hi every one i am working on qt creator. i have a list 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()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM