Ok, it does work now. The problematic line was:

Qt Code:
  1. ui.timeSampleSlider->setScaleMaxMinor(0);
To copy to clipboard, switch view to plain text mode 

Which is weird, but without that line my code works exactly as yours. Thanks for your time!