title: Qt4/PyQt4 - Can not set the default font for QTextDocument
body: <p>My code is like this:</p>
  
  <pre><code>from PyQt4 import QtGui
  
  doc = QtGui.QTextDocument()
  d_font = QtGui.QFont('Times New Roman')
  doc.setDefaultFont(d_font)
  
  cur = QtGui.QTextCursor(doc)
  cur.insertText('sample text')
  
  writer = QtGui.QTextDocumentWriter()
  writer.setFormat(writer.supportedDocumentFormats()[1])
  writer.setFileName('CV')
  writer.write(doc)
  </code></pre>
  
  <p>The 'sample text' in the output is still 'Sans' on my computer rather than "Times New Roman'. I have made sure my computer has 'Times New Roman' font. I suspect this is a bug. I'm using PyQt v4.9.5. </p>
  
  <p><strong>EDIT:</strong> I'm using Ubuntu 12.04. I'm quite sure that PyQt4 can find the font, because the following code works:</p>
  
  <pre><code>d_font = QFont('Times New Roman')
  char_fmt = QTextCharFormat()
  char_fmt.setFont(d_font)
  cur.insertText('Times New Roman', char_fmt)
  </code></pre>
  
  <hr>
  
  <p>It appears that not all formating is supported when saving in odt/odt format, but everything works as expected when printing to a pdf. </p>
  
  <pre><code>from PyQt4.QtGui import *
  import sys
  
  doc = QTextDocument()
  cur = QTextCursor(doc)
  
  d_font = QFont('Times New Roman')
  doc.setDefaultFont(d_font)
  
  table_fmt = QTextTableFormat()
  table_fmt.setColumnWidthConstraints([
      QTextLength(QTextLength.PercentageLength, 30),
      QTextLength(QTextLength.PercentageLength, 70)
      ])
  table = cur.insertTable(5,2, table_fmt)
  cur.insertText('sample text 1')
  cur.movePosition(cur.NextCell)
  cur.insertText('sample text 2')
  
  # Print to a pdf file
  # QPrinter: Must construct a QApplication before a QPaintDevice
  app = QApplication(sys.argv)
  printer = QPrinter(QPrinter.HighResolution)
  printer.setOutputFormat(QPrinter.PdfFormat)
  printer.setOutputFileName('sample.pdf')
  
  # Save to file
  writer = QTextDocumentWriter()
  writer.setFormat(writer.supportedDocumentFormats()[1])
  writer.setFileName('sample.odt')
  writer.write(doc)
  </code></pre>
  
  <p>setDefaultfonts and setColumnWidthConstraints affect sample.pdf, but not sample.odt.</p>