title: Making zooms on an QWidget while inside a QScrollArea
body: <p>I want to show a pixmap on Qt and make able to zoom, I'm using a QWidget inside a QScrollArea, but the ScrollBars of the area are not working, when I zoom on the image, the image gets bigger, but there is no scrollbars so i can move, let me show you some code :</p>
  
  <p>Here is how I'm declaring the Widgets :</p>
  
  <pre><code>_scroll = new QScrollArea(_frame);
  _image_widget = new QImageWidget(_scroll);      
  _scroll-&gt;setBackgroundRole(QPalette::Dark);
  _scroll-&gt;setWidget(_image_widget);
  _scroll-&gt;setWidgetResizable(true);
  </code></pre>
  
  <p>_frame is the area where i should show the hole thing, _image_widget is an object of QImageWidget which is inheriting from QWidget</p>
  
  <p>if I dont use this : <code>_scroll-&gt;setWidgetResizable(true);</code>   the image is just too small </p>
  
  <p>And here is how I deal with the Zoom :</p>
  
  <pre><code> void QImageWidget::paintEvent(QPaintEvent *ev) {
      QPainter p(this);
      if(pixmap() != NULL){
          int w = pixmap()-&gt;width();
          int h = pixmap()-&gt;height();
          QPixmap map = pixmap()-&gt;scaled(w*zoom,h*zoom,Qt::KeepAspectRatio);
          p.drawPixmap(0, 0, map );
      }     
  }
  
  void QImageWidget::wheelEvent ( QWheelEvent * e )
      {
      int x = e-&gt;pos( ).x();
      int y = e-&gt;pos( ).y();
  
      if (e-&gt;delta() &gt; 0) 
          zoom *= 2;
      else
          if(zoom &gt; 1)
      zoom /= 2;
  }
  </code></pre>
  
  <p>SO the problem is as I said, the image keeps getting bigger when i'm zooming until it takes the hole area of the <code>QScrollArea</code> and then when I keep zooming, the zoom is working but there is no ScrollBars so i can see the other part of the Image. </p>
  
  <p>Tell me if i'm not understandable !
  thanks !</p>