PDA

View Full Version : QTextCharFormat::setAnchor



ccf_h
30th November 2008, 17:01
I'm trying to insert a hyperlink into an QTextEdit. It works as indicated below, but it becomes only visible after reloading the content of QTextEdit (last two lines).
Why is that? It should become visible without lines 6 and 7!


cur_format = currentCharFormat();
cur_format.setAnchor(true);
cur_format.setAnchorHref(text);
cursor.mergeCharFormat(cur_format);
mergeCurrentCharFormat(cur_format);
QString text_all(toHtml());
setHtml(text_all);