English Deutsch
Table of Content
How to use QTextEdit
Overview
With QTextEdit [qt-project.org], you get an easy to use class to create a rich text field. With this text field, you can display plain text, but also rich text like HTML-formatted text and images.
Important methods
Resets the displayed text to the specified one.
Appends the specified text to the displayed text.
Returns the content of the QTextEdit text field as HTML-formatted text.
Returns the content of the QTextEdit text field as plain text.
Example
QTextEdit can be used for multiple purposes, here is a simple editor:
- #include <QApplication>
- #include <QTextEdit>
- int main(int argc, char **argv)
- {
- txt->setText("Hello, world!\n");
- txt->append("Appending some text...");
- txt->show();
- return app.exec();
- }

