Beginner: Formatting text output (PyQt4)

Jeremy Sanders jeremy+complangpython at jeremysanders.net
Thu Apr 19 04:27:23 EDT 2007


Glen wrote:

> What seems to be happening is that the font that pyqt is using is not
> fixed width, so I did this:
> qTxtFormat = QTextCharFormat()
> qTxtFormat.setFontFixedPitch(True)
> ui.textEdit.setCurrentCharFormat(qTxtFormat)

Does something like ui.textEdit.setCurrentFont(QFont('fixed')) work? It
seems to work for me if you use plain text.

Tabs or html/rich text formatting should be a better way to get the layout
(or just use a table).

Jeremy

-- 
Jeremy Sanders
http://www.jeremysanders.net/



More information about the Python-list mailing list