Refreshing program state after a certain amount of time
Good Evening and Happy Easter,
I'm working on a p2m client, and I made a class to represent particular downloaded files. After having the necessary data given by user, I want to show the info about added file in a table. I made such table, where 1 file = 1 row. Apart of file name, file size, output folder, there are some data which should change dynamically - amount of currently downloaded kBs, progress bar indicating how many percents of the file size were currently downloaded, file state (downloading, preparing, paused, error). I don't know what is the best way to do it. Should I refresh program state every x seconds? How?
Re: Refreshing program state after a certain amount of time
Use a QTimer to update the ui every second - thats more CPU friendly.
Re: Refreshing program state after a certain amount of time
But how to do it "in the background"? I mean, user is using the program all the time (he runs a lot of functions, slots, opens additional windows, etc.) but the ui is still updating (independently!).
Re: Refreshing program state after a certain amount of time
Ok, I've taken a look on the QTimer class and it is really convienient and easy. Thank you for your response then, fatjuicymole.