1

The code below creates a single QTextBrowser, fills it with 25 lines of text and finds a line 'Line of text # 0011' using view.find method which aside from finding the text selects it as well.

How to deselect the text selected by .find method?

enter image description here

from PyQt4 import QtCore, QtGui
app = QtGui.QApplication([])

view = QtGui.QTextBrowser() 
for i in range(25):
    view.append('Line of text # %004d'%i )

view.moveCursor(QtGui.QTextCursor.End)
view.find('Line of text # 0011', QtGui.QTextDocument.FindBackward)

view.show()
app.exec_()
alphanumeric
  • 17,967
  • 64
  • 244
  • 392
  • It was not a duplication! The QTextBrowser is not equal with the QTextEdit wich is linked to this question. –  Mar 15 '19 at 16:26

0 Answers0