PDA

View Full Version : QTextCharFormat and Hyperlinks



Rayven
8th January 2010, 22:12
I have a QTextEdit that I am inserting a hyperlink at the word under the cursor. However, when the anchor is inserted, the QTextEdit does not display the typical hyperlink (Colored and Underlined) but the HTML dump contains the correct anchor.



QTextCharFormat fmt;
fmt.setAnchor( true );
fmt.setAnchorHref( href );

ui_textEdit->textCursor().mergeCharFormat( fmt );
ui_textEdit->textCursor().mergeCurrrentCharFormat( fmt );


If I directly insert HTML code with the anchor at the text cursor, everything appears correctly in the text edit.