Basically your code does that:
MainWindow::main->addTab(panel->getWidget(), "nT");
ui->scrollPanel->setWidget(panel->getWidget());
And since a widget can only be at one place at a time, once you add it to the scroll panel, it is removed from the QTabWidget
where you just put it.
However you could create a new QTextEdit
that would share the same underlying QTextDocument
by using QTextEdit::document()/setDocument().