Infinite condition checking
-
Hi,
Since foo checks the condition on each call, in fact, you want something that calls regularly foo ?
-
Hi,
Since foo checks the condition on each call, in fact, you want something that calls regularly foo ?
-
You might want to consider making a QTimer member variable to be able to stop it for example when your application ends.
-
You might want to consider making a QTimer member variable to be able to stop it for example when your application ends.
-
I don't know how long foo will take so you might not want for it to triggered when you end your application. Ending an application does not mean everything is destroyed instantly.
-
I don't know how long foo will take so you might not want for it to triggered when you end your application. Ending an application does not mean everything is destroyed instantly.
-
@SGaist foo is not from the mainwindow, is part of another class, should I call stop in the destructor?
@hbatalha said in Infinite condition checking:
is part of another class
Then put it there as member variable and stop it in destructor (or whenever needed).
-
@hbatalha said in Infinite condition checking:
is part of another class
Then put it there as member variable and stop it in destructor (or whenever needed).
-
I don't know how long foo will take so you might not want for it to triggered when you end your application. Ending an application does not mean everything is destroyed instantly.
Ending an application does not mean everything is destroyed instantly.
I have followed your suggestion, and now I am wondering, is this something that I have to always watch out for, is there a name for this kind of situation, a reference I can search?
And also, why is everything not destroyed instantly? What are the steps being taken? What is happening under the hood there? Any reference?
-
Order of destruction, code run during destruction, etc
Think of a database, you likely appreciate the fact that all operations are finalised before it stops so you don't have corrupted data when you restart it.