& lt;Qt Cosmopolitan; scrolling subtitles
* in cpp***
QTimer * timer = new QTimer (this); connect (timer,SIGNAL (timeout ()), this,SLOT (scrollCaption (); timer- > start (1000); … Void MainWindow::scrollCaption () {static int nPos = 0; / / when the intercepted position is longer than the string, if (nPos > str.length ()) nPos = 0; ui- > label_2- > setText (str.mid (nPos)); QString str2 = ui- > label_2- > text (). Append ("" + str.left (nPos) + ") Ui- > label_2- > setText (str2); nPos++;}
Other parts are the same as the previous one.