[PyQt] setTextFormat missing in QTextEdit

Mark Summerfield mark at qtrac.eu
Thu May 24 17:55:46 BST 2007


On Thu 24-May-07, Mike Tammerman wrote:
> Hi,
>
> setTextFormat and textFormat are missing QTextEdit. They are also not
> existant in the PyQt4 class reference.
>
> I am using Qt 4.2.3 and PyQt 4.2
>
> Mike

I believe those methods are Qt 3-specific. In C++/Qt they are still
available, but to quote the documentation "They are provided to help you
port old code to Qt 4. We advise against using them in new code."

Qt 4 usage is to set text using setPlainText() and insertPlainText(), or
setHtml() and insertHtml(), and to retrieve using toPlainText() or
toHtml(). You can also call acceptRichText(bool) to control whether the
user can insert HTML, e.g., by pasting HTML from elsewhere.

-- 
Mark Summerfield, Qtrac Ltd., www.qtrac.eu



More information about the PyQt mailing list