Ok,

Here are some details:

1. I am sub classing tabWidget.
2. There is only one textEdit widget.
3. When ever you create a new tab, you reparent the textEdit to the newly created tab.
4. when you delete a tab, you reparent the textEdit to the current tab.

Qt Code:
  1. void myTabWidget::addNewTab(const char *tabName)
  2. {
  3. // Create a new widget
  4. QWidget *newTab = new QWidget(this);
  5. // Add a new tab
  6. this->addTab(newTab, QIcon("../images/win/tabicon.png"), tr(tabName));
  7. // Set size of this widget to size of this
  8. newTab->resize(this->size());
  9. // Make this tab current one.
  10. this->setCurrentIndex(this->count()-1);
  11. // Parent text to this tab.
  12. centerText->setParent(newTab);
  13. // Set size of text equal to size of tab
  14. centerText->resize(newTab->size());
  15.  
  16. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void myTabWidget::tabChanged(int index)
  2. {
  3. // Reparent text to current widget
  4. centerText->setParent(this->currentWidget());
  5. //Note:
  6. //The widget becomes invisible as part of changing its
  7. //parent, even if it was previously visible. You must
  8. //call show() to make the widget visible again.
  9. centerText->show();
  10. // Set size of text equal to size of tab/widget
  11. centerText->resize(this->currentWidget()->size());
  12. }
To copy to clipboard, switch view to plain text mode 

This tab widget is centerWidget and there are docks (left, right and bottom) to it.
When you resize the main window or you resize the dock the textedit should cover the
whole tab area.

Prashant