textEdit_2->setText("text");
The problem is that you are trying to ignore the actual text widget created in QtDesigner
and invent another as a class member. This is not going to fly as you seem to want it.
In order to reuse the text widget from the UI that you created with the graphical tool, you would need to reuse the ui
object as follows:
ui->textEdit_2->setText("text");
Please also note that you do not need to construct QString
explicitly like this:
textEdit_2->setText(QString("text"));
This will be all automatic for you.