Chang Zhao
Chang Zhao

Reputation: 631

how do I clear the contents of qtextbrowser in pyqt5?

How can I clear the content of QTextBrowser ? I have tried clearHistory() as well as setting the cursor opstion but didint help

does anyone know how to clear the content of the Qtextbrowser

Upvotes: 3

Views: 4553

Answers (1)

eyllanesc
eyllanesc

Reputation: 243973

QTextBrowser inherits from QTextEdit so its methods also inherit it, considering the above a QTextEdit clear the contents with the clear() method so it also works for QTextBrowser: self.textBrowser.clear().

Recommendation: You should read the Qt docs to know all the methods of each class, for example from QTextBrowser https://doc.qt.io/qt-5/qtextbrowser-members.html

Upvotes: 6

Related Questions