How scroll to a specific html tag in QTextEdit?
-
I write a some text in QTextEdit that have different background for some words. now i want to able to scroll to one of the them with pressing a button (like a next button).
I try to add name to the span tags and then use scrollToAnchor() to move the scrollbar but when add html to text edit, it delete my name .myTextEdit.setHTML(<span name="scrollToMe">some thing</span>) myTextEdit.scrollToAnchor("scrollToMe")
anyone know how to fix this?or another solution ?
-
I write a some text in QTextEdit that have different background for some words. now i want to able to scroll to one of the them with pressing a button (like a next button).
I try to add name to the span tags and then use scrollToAnchor() to move the scrollbar but when add html to text edit, it delete my name .myTextEdit.setHTML(<span name="scrollToMe">some thing</span>) myTextEdit.scrollToAnchor("scrollToMe")
anyone know how to fix this?or another solution ?
@abdoll78 said in How scroll to a specific html tag in QTextEdit?:
when add html to text edit, it delete my name
Have you checked the documentation?
The text can be set or replaced using setHtml() which deletes any existing text and replaces it with the text passed in the setHtml() call