title: QScrollArea missing Scrollbar
body: <p>I think it is the same problem as : <a href="https://stackoverflow.com/questions/11555557/qscrollarea-resizing-qwidget">QScrollArea resizing QWidget</a></p>
  
  <p>but there are not solution. so let me expose the problem.</p>
  
  <ul>
  <li>test 2 inherited from QWidget:
  
  <ul>
  <li>composed :
  
  <ul>
  <li>vector of QSpinBox</li>
  <li>QScrollArea</li>
  <li>QVBoxLayout</li>
  </ul></li>
  <li>test2 (QWidget) &lt;- QScrollArea &lt;- QVBoxLayout &lt;- Spinbox</li>
  </ul></li>
  <li>Problems :
  
  <ul>
  <li>There are no scrollbar</li>
  <li>[FIXED] The inside of the scrollbar is shrinked to fit so little space nothing can be read (the window can be resized during execution that will cause the inside to get bigger and be readable nevertheless no scrollbar will appear)</li>
  </ul></li>
  </ul>
  
  <p>I Think problems come from a single source :: Size Hints and Layouts (<a href="http://qt-project.org/doc/qt-5.1/qtwidgets/qscrollarea.html#details" rel="nofollow noreferrer">http://qt-project.org/doc/qt-5.1/qtwidgets/qscrollarea.html#details</a>)</p>
  
  <p>The second problem (shrinked widget) can be solved by setting "c->setSizeConstraint(QLayout::SetMinimumSize);"</p>
  
  <p>I am currently seeking a solution for the missing scrollbar</p>
  
  <p>here is a code showing my problem :</p>
  
  <pre><code>&lt;c++&gt;
  #include &lt;QWidget&gt;
  #include &lt;QScrollArea&gt;
  #include &lt;QVBoxLayout&gt;
  #include &lt;QSpinBox&gt;
  
  class test2 : public QWidget
  {
          Q_OBJECT
      public:
          test2(QWidget *parent = 0) :QWidget(parent)
          {
              b = new QScrollArea(this);
              c = new QVBoxLayout;
  
              for (int i = 0; i &lt; 10; i++)
              {
                  a.push_back(new QSpinBox());
                  c-&gt;addWidget(a[i]);
              }
  
              c-&gt;setSizeConstraint(QLayout::SetMinimumSize);
              b-&gt;setLayout(c);
              b-&gt;resize(200, 200);
          }
  
          ~test2()
          {
              for (int i = 0; i &lt; 10; i++)
                  delete a[i];
          }
  
      protected:
  
          QVector&lt;QSpinBox*&gt; a;
          QScrollArea* b;
          QVBoxLayout* c;
  
  };
  
  
  int main(int argc, char *argv[])
  {
      ///*
      QApplication app(argc, argv);
  
      test2 a;
  
      a.show();
  
      return app.exec();//*/
  }
  </code></pre>
  
  <p>EDIT :: found a Solution here:
  <a href="http://qt-project.org/forums/viewthread/295" rel="nofollow noreferrer">http://qt-project.org/forums/viewthread/295</a></p>
  
  <p>if you don't want to read huge amount of useless code here what he has done ::
  he warped the layout inside a widget</p>
  
  <p>Solution :: inherit the Object from ScrollBar &lt;- Widget &lt;- Layout</p>
  
  <p>instead of widget &lt;- ScrollBar &lt;- Layout</p>
  
  <p>but it a work around not really a solution...
  I going to try on the example I gave.</p>
  
  <p>it works. Does anyone have a better solution ??</p>