title: Resizing a QPixmap inside a QLabel according to the Window
body: <p>In my window class, inheriting of QMainWindow, I have a QLabel containing a QPixmap, updated every 20ms.</p>
  
  <p>I want the QLabel, and the QPixmap inside it, to be resized according to the resizing of the window.</p>
  
  <p>I want this Central Widget to take as much space as neccessary but also to be able to resize it down. Even smalled than the original size. But always keeping the ratio.</p>
  
  <p>The actual code :</p>
  
  <pre><code>// in the window constructor
  this-&gt;setWindowFlags(Qt::Window);
  this-&gt;resize(500, 300);
  
  this-&gt;setCentralWidget(this-&gt;label);
  
  // in the updating function
  QPixmap output;
  output = output.fromImage(Mat2QImage(theImage));
  this-&gt;label-&gt;setPixmap(output);
  </code></pre>
  
  <p>Now I've tried with :</p>
  
  <pre><code>output.scaled(this-&gt;label-&gt;x(), this-&gt;label-&gt;y(), Qt::KeepAspectRatio)
  </code></pre>
  
  <p>but it doesn't work ...
  How can I do that ?</p>
  
  <p>EDIT : I'm using Qt 5.3</p>