title: Setting initial size of QTabWidget
body: <p>I am creating a QTabWidget that has a number of tabs and each tab contains a different number of push buttons. Because some of these tabs may include many push buttons, I would like to make each tab scrollable. </p>
  
  <p>I have an implementation that sort of works except no matter what I try I can't get the darn QTabWidget to be of a particular vertical size - it always wants to size itself based on the maximum height used by one of its pages. I've tried changing size policies, layout strategies and nothing works.</p>
  
  <p>Here is exact widget structure I am using:</p>
  
  <pre><code>QFrame
      QSplitter
          QTabWidget
          QFrame
  </code></pre>
  
  <p>I populate the QTabWidget with QWidget instances that serve as pages. These instances are wrapped around with a QScrollArea and use a QGridLayout so that I can populate the tab with push buttons in a grid.</p>
  
  <p>Here is the actual code that populates the tab widget:</p>
  
  <pre><code>for (const std::string &amp;tabName : tabs) {
      // Grid layout for each tab
      QGridLayout *gridLayout = new QGridLayout();
  
      // The tab widget itself
      QWidget *page = new QWidget(tabWidget);
      page-&gt;setLayout(gridLayout);
  
      // Wrap tab with a scroll area so that it's scrollable when the tab widget
      // is resized to be smaller than the page size
      QScrollArea *scrollArea = new QScrollArea(tabWidget);
      scrollArea-&gt;setWidgetResizable(true);
      scrollArea-&gt;setWidget(page);
  
      tabWidget-&gt;addTab(scrollArea, tabName.c_str());
  
      // Populate tab with push buttons
      const std::vector&lt;std::string&gt; &amp;buttons = GetButtons(tabName);
      for (const std::string &amp;buttonName : buttons) {
          QPushButton *button = new QPushButton(buttonName.c_str());
          button-&gt;setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
          QSize buttonSize(130, 20);
          button-&gt;setFixedSize(buttonSize); // &lt;=== this does work
          int row = i / numColumns;
          int col = i % numColumns;
          gridLayout-&gt;addWidget(button, row, col, Qt::AlignLeft | Qt::AlignTop);
      }
  }
  
  // This does not work
  const int fixedVerticalSize = 120;
  tabWidget-&gt;resize(tabWidget-&gt;size().width(), fixedVerticalSize); 
  </code></pre>
  
  <p>BTW, I am using Qt 5.0.2 on Mac OS X 10.8.2.</p>