You have to cast the window to the type of your class (not just to a QMainWindow).
A QMainWindow does not exhibit that timer.
(You might also prefer not to access internals of your class like that. How about adding a slot "stopTimer()" to your class?)
HTH
Bookmarks