c++ - Incorporate setText and setNum into a label in Qt? -
i have few simple lines of code of slot horizontal slider:
void newwindow::on_horizontalslider_valuechanged(int value) { ui->label->setnum(value); }
now, instead of label displaying number (such "11" or "42"), how make display "value: 11"?
i think have incorporate settext too, although don't know how that.
there's simple solution haven't found yet. help?
use qstring::number
convert int qstring
:
ui->label->settext(qstring("value: ") + qstring::number(value));
Comments
Post a Comment