title: How to rotate the second hand of the clock with Qt
body: <p>I am using the code below to try to rotate the pointer simulating the second hand of the clock, but when he turns it cuts, the square of the background is fixed and it seems I'm not able to rotate all:</p>
  
  <pre><code>   QPixmap shipPixels(":/new/prefix1/imagem/ponteiro.png");
     QPixmap rotatePixmap(shipPixels.size());
     rotatePixmap.fill(Qt::transparent);
  
     QPainter p(&amp;rotatePixmap);
  
     p.translate(rotatePixmap.size().width() / 2, rotatePixmap.size().height() / 2);
     p.rotate(90);
     p.translate(-rotatePixmap.size().width() / 2, -rotatePixmap.size().height() / 2);
  
     p.drawPixmap(0, 0, shipPixels);
     p.end();
  
     shipPixels = rotatePixmap;
     ui-&gt;label-&gt;setPixmap(rotatePixmap);
  </code></pre>
  
  <p>The pointer looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/3btze.jpg" alt="Pointer">
  Now with it rotated 90 º
  <img src="https://i.stack.imgur.com/neiFF.jpg" alt="With 90º"></p>