If you're using QtCreator, you can attach the QTextEdit() object to what is usually declared centralWidget (QWidget).
I basically took this from the auto-generated code ui_mainwindow.h (using QtCreator).
void setupUi(QMainWindow *MainWindow)
{
QWidget* centralWidget = new QWidget(MainWindow);
centralWidget->setObjectName(QStringLiteral("centralWidget"));
QTextEdit* textEdit = new QTextEdit(centralWidget);
textEdit->setObjectName(QStringLiteral("textEdit"));
textEdit->append("Hello");
}