b1gsnak3
13th December 2012, 08:37
Hello,
Can anyone tell me how do I save html tags in a QString from a QTextBrowser? Afterwards I will need to put it back in QTextBrowser with the appropiate tags. Getting the text with toPlainText() doesn’t work. Tried with toHtml() and then when putting the qstring back with setHtml() but it doesn’t work. I’m using this to customize the text displayed(bold, italic, underline) and I need to have an option that adds and removes timestamps from the text. To add / remove the timestamps I have to go through all the text in the textbrowser. It displays something like:
UserName: text (without timestamps)
UserName (timestamp): text (with timestamps)
BTW doesn’t work with “<†and “>â€. It saves the tags but displays the tags in textbrowser (don’t need to display them, just to make them work)
Thank you in advance.
Qt 4.8.4 with MinGW
Windows 7
Can anyone tell me how do I save html tags in a QString from a QTextBrowser? Afterwards I will need to put it back in QTextBrowser with the appropiate tags. Getting the text with toPlainText() doesn’t work. Tried with toHtml() and then when putting the qstring back with setHtml() but it doesn’t work. I’m using this to customize the text displayed(bold, italic, underline) and I need to have an option that adds and removes timestamps from the text. To add / remove the timestamps I have to go through all the text in the textbrowser. It displays something like:
UserName: text (without timestamps)
UserName (timestamp): text (with timestamps)
BTW doesn’t work with “<†and “>â€. It saves the tags but displays the tags in textbrowser (don’t need to display them, just to make them work)
Thank you in advance.
Qt 4.8.4 with MinGW
Windows 7