title: Print PrettyTable data to QPlainTextEdit
body: <p>My setup is Windows 10, Python 3.7, PyQt5</p>
  <p>The goal is to print a <strong>formatted table</strong> to a <strong>QPlainTextEdit</strong>.</p>
  <p>I have some data in a <strong>PrettyTable</strong> object. When I print this data to stdout, the table gets printed perfectly! But when printing to QPlainTextEdit (using table.get_string())... it looses the correct format.</p>
  <p>A small code to show the issue:</p>
  <pre><code>import sys
  
  from PyQt5.QtWidgets import (
      QApplication, QLabel, QPlainTextEdit, QVBoxLayout, QWidget)
  from prettytable import PrettyTable
  
  class Example(QWidget):
  
  def __init__(self):
      super().__init__()
  
  self.initUI()
  
  def initUI(self):
      hbox = QVBoxLayout(self)
  
  qpt = QPlainTextEdit(self)
  qpt.setReadOnly(True)
  
  x = PrettyTable()
  x.field_names = [&quot;City name&quot;, &quot;Area&quot;, &quot;Population&quot;, &quot;Annual Rainfall&quot;]
  x.add_rows(
      [
          [&quot;Adelaide&quot;, 1295, 1158259, 600.5],
          [&quot;Brisbane&quot;, 5905, 1857594, 1146.4],
          [&quot;Darwin&quot;, 112, 120900, 1714.7],
          [&quot;Hobart&quot;, 1357, 205556, 619.5],
          [&quot;Sydney&quot;, 2058, 4336374, 1214.8],
          [&quot;Melbourne&quot;, 1566, 3806092, 646.9],
          [&quot;Perth&quot;, 5386, 1554769, 869.4],
      ]
  )
  qpt.appendPlainText(x.get_string())
  
  hbox.addWidget(qpt)
  
  self.resize(400, 300)
  self.setWindowTitle('QPlainTextEdit')
  self.show()
  
  def main():
      app = QApplication(sys.argv)
      ex = Example()
      sys.exit(app.exec_())
  
  if __name__ == '__main__':
      main()
  </code></pre>
  <p><a href="https://i.stack.imgur.com/1h46u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1h46u.png" alt="enter image description here" /></a></p>
  <p>How to achieve the correct format for the table?</p>