You need to covert integer to the QString
to be able to concat it to the QString
. Even better, you can use QString::arg function and get readable and potentially faster code very easily:
tab_widget->addTab(page, QString("File-%1").arg(i++));
Where i
is field in your class initialized to 1.