Hi,
I have a QTextDocument (in an QTextEdit) that contains HTML formatted text. Based on the enclosing tag (if any) I need to perform different tasks when the user presses the enter key.
How can I get the enclosing tag?
/Regards
Hi,
I have a QTextDocument (in an QTextEdit) that contains HTML formatted text. Based on the enclosing tag (if any) I need to perform different tasks when the user presses the enter key.
How can I get the enclosing tag?
/Regards
I assume you mean the text visible to the user is HTML.
A naive approach: Look backward for the most recent open tag (if any), look forward for the next close tag (if any), if you have two tags and they match then you have your answer.
Were you expecting a Qt supplied findTheEndTagIfAny() function?
Hi,
no I mean that the user visible text is formatted using HTML but shown as in a WYSIWYG editor.
However if this means that the text that I can access contains the tags then it will be easy. But I kinda assumed that the html is converted into some formatting hidden inside some propertied associated with the different blocks/frames.
/Regards
Bookmarks