Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

& lt;Qt Cosmopolitan; scrolling subtitles

Shulou Source: shulou.com Published: 2022-06-03 02:40:49 09月28日 Update

* 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.

Tags: Ab initio position character string part long subtitle Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Redmi MariaDB NVidia Huawei