@YuXin said in QProgressBar has rendering errors or does not render at all:
The timing of the startTimer does not affect the issue.
In principle an odd number is more likely to trigger QDateTime::currentMSecsSinceEpoch() % 2 being true on alternates than always being either true or false.
the purpose of this if statement is exactly as you assumed: to randomly trigger setValue
Exactly. And for that you would be much better off using a random number than your potentially-deterministic QDateTime::currentMSecsSinceEpoch() % 2 .
Anyway, I am sorry if we digressed. I intended this to be a brief comment, especially for posting for others to reproduce.