pyqt textarea

QPlainTextEdit is a multiline text area in PyQt. To set the text, we use its method insertPlainText(). We can set its position and size using the methods move() and resize().

pyqt text area

Related course:

Textarea

The example below creates a text area using PyQt5.

We will create the usual QMainWindow to add the widget to. It is just for plain text, like notepad. To add new lines we add the \n character.

Previous Post
Next Post

Leave a Reply