Change a label's text when a variable changes
-
I currently have this label:
ui->label->setText("<font color='red'>Changing...");
But i want it to output "Changing...X/10" With X being a certain variable that is being incremented in a loop, How would I pass in the int variable to the text
-
@rtvideo
Look at theQString::arg()
family of methods, like the example at https://doc.qt.io/qt-5/qstring.html#arg. There is alsoQString::number()
for just a number alone.