I hope someone can help me with my scrollArea problem:

I defined a scroll area and set a tab widget in it:
Qt Code:
  1. scrollArea_ = new QScrollArea;
  2. setCentralWidget( scrollArea_);
  3. scrollArea_->setWidgetResizable ( true );
  4. scrollArea_->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
  5. scrollArea_->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded
  6. scrollAreaGridLayout_ = new QGridLayout(scrollArea_);
  7. scrollAreaWidget_ = new QWidget();
  8. scrollAreaGridLayout_->addWidget(scrollAreaWidget_, 0, 1, 1, 1);
  9. scrollArea_->setWidget(scrollAreaWidget_);
  10. tabWidget_ = new QTabWidget();
  11. scrollAreaGridLayout2_ = new QGridLayout(scrollAreaWidget_);
  12. scrollAreaGridLayout2_->addWidget(tabWidget_, 0, 1, 1, 1);
  13. tabWidget_->setEnabled(true);
To copy to clipboard, switch view to plain text mode 

So far everything is fine. Later in the code I change the tabWidget_ contents (and size) and the scrollArea displays correctly.
Depending on the user actions this scrollArea_ should display different things.
So when I change the display:
Qt Code:
  1. tabWidget_->hide();
  2. newProfile_->show(); // Another QTabWidget()
  3. scrollAreaGridLayout2_->addWidget(newProfile_, 0, 1, 1, 1);
To copy to clipboard, switch view to plain text mode 

The scrollArea gets updated with the new size and appropriate scroll bars.

Problem: my program changes the newProfile_ QabWidget to display other tabs which are bigger but it seems the scrollArea and the scroll bars are not updated and I can't scroll to see the bigger tabs. I tried to get the new size of the tab and resize the QabWidget and the scrollArea but nothing seems to help.
Qt Code:
  1. newProfile_->hide();
  2. newProfile_->resize( newQWidgetWidth(), newQWidgetHeight() );
  3. newProfile_->updateGeometry();
  4. scrollArea_->resize( newQWidgetWidth(), newQWidgetHeight() );
  5. scrollArea_->updateGeometry();
  6. scrollAreaWidget_->resize( newQWidgetWidth(), newQWidgetHeight() );
  7. scrollAreaWidget_->updateGeometry();
  8. missionProfile_->show();
  9. scrollAreaGridLayout2_->addWidget(newProfile_, 0, 1, 1, 1);
To copy to clipboard, switch view to plain text mode 

Can anyone suggest a solution?