[PyQt] QtextBrowser.toPlainText bug (Python 3, Linux only)

Florian Bruhin me at the-compiler.org
Thu Mar 5 15:50:08 GMT 2015


* Edward K. Ream <edreamleo at gmail.com> [2015-03-05 09:42:30 -0600]:
> On Python 3 only (3.4.0) and PyQt 5.2.1, QTextBrowser.toPlainText() returns
> a unicode (Python 3 str) string with a value that does not match the value
> shown in the QTextBrowser!  For example, the widget shows: Text: ÷ Σ but
> toPlainText returns Text: ÷ £

Have you tried with more recent PyQt/Qt versions?

I can't reproduce this on Qt 5.3.2 on Debian Jessie with python3:

    from PyQt5.QtCore import QT_VERSION_STR
    from PyQt5.QtWidgets import QApplication, QTextBrowser
    a = QApplication([])
    tb = QTextBrowser()
    tb.setText('÷ Σ')
    print(QT_VERSION_STR)
    print(tb.toPlainText())

-> prints 5.3.2 and ÷ Σ

Florian

-- 
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150305/53707b86/attachment.sig>


More information about the PyQt mailing list