@JonB Thanks for your awesome reply. I think you are right. It only causes a problem (in the original example) if in on_pushButton_2_clicked the code calls setRange first and then call setTickInterval because (apparently) only setRange calls calcuilateLayout as you determined.
I have submitted a bug report to Qt (QTBUG-124158). For now, I will mark this forum topic as 'solved' and then after the QTBUG is resolved I will come back to this forum topic and update it.