title: QImage resizing
body: <p>I'm coding small graphics editor and need some help.
  I'm painting QImage like this:</p>
  
  <pre><code>void Editor::paintEvent(QPaintEvent *event)
  {
      QPainter painter(this);
  
      // zoom is an int, representing zoomFactor from 1 to 12.
      painter.drawImage(
          QRect(0, 0, image.width() * zoom , image.height() * zoom),
          image);
  
      if (zoom &gt;= 3 &amp;&amp; showGrid) {
          painter.setPen(palette().foreground().color());
          painter.setPen(Qt::DotLine);
  
          // this is how I draw grid
          for (int i = 0; i &lt;= image.width(); ++i)
              painter.drawLine(zoom * i, 0,
                  zoom * i, zoom * image.height());
          for (int j = 0; j &lt;= image.height(); ++j)
              painter.drawLine(0, zoom * j,
                  zoom * image.width(), zoom * j); 
      }
  
      // (...)
  } 
  </code></pre>
  
  <p>It works fine with images like this (16 x 16)
  <img src="https://i.imgur.com/HVf6O.png" alt="1"></p>
  
  <p>Troubles begin when I open images like this (25 X 28)</p>
  
  <p><img src="https://i.imgur.com/1DgHO.png" alt="2"></p>
  
  <p>As you can see pixels are drawn with different width and height!
  What am I doing wrong? Please, help :)</p>
  
  <p><strong>UPD:</strong> Problem solved unexpectedly. I noticed, that Editor was QGLWidget, so I tried to change it to QWidget and everything worked just fine. Stupid me -_-
  Btw, may be there's more convenient ways to zoom image?(like crop pixels, that are not needed to be painted)</p>