title: PyQt: Center QPainter text with drawText in QPrinter
body: <p>I am trying to focus the text on a normal A4 size folio, the sizes obtained are correct but it is not centered and I do not know what the reason is, here I show you the code</p>
  
  <pre><code>from PyQt4.QtGui import QPrinter,QPainter,QApplication
  from PyQt4.QtCore import Qt,QRectF
  import sys
  
  app = QApplication(sys.argv)
  
  printer = QPrinter()
  painter = QPainter()
  
  printer.setOutputFileName("prueba.pdf")
  printer.setOutputFormat(QPrinter.PdfFormat)
  
  printer.setPageMargins(0.0,0.0,0.0,0.0,1)
  printer.setFullPage(True)
  margin = printer.getPageMargins(1)
  print margin
  size = printer.paperSize(1)
  width = size.width()
  print width
  
  painter.begin(printer)
  painter.drawText(QRectF(0.0,0.0,width,50.0),Qt.AlignCenter|Qt.AlignTop,"abcdefghijklmn")
  painter.end()
  </code></pre>
  
  <p>As you can see I get the width of the size of a folio type point and putting the entire width of the folio does not fit evenly</p>