Skip to content
Advertisement

How to darken selected text of `textEdit.find()` in PyQt5?

I have this method that finds a term in a textEdit:

JavaScript

Now the function is working properly but the textedit.find(term) seems to just lightly highlight the found text like this

My question is if textedit.find(term) can select the found text like this

Advertisement

Answer

You have to change the color associated with QPalette::Highlight:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement