& lt;Qt changing speed is realized by the variable speed timer
/ / Dialog.h
Private:QTimer * timer
/ / Dialog.cpp
/ / timer = new QTimer (this) in the constructor; connect (timer, SIGNAL (timeout ()), this, SLOT (update (); updatetime (); / / external void Dialog::updatetime () {if (speed==1) timer- > stop (); else timer- > start (300-speed*10);}
After that, the functions in SLOT can change the speed.