Results 1 to 1 of 1

Thread: QTextCharFormat::setAnchor

  1. #1
    Join Date
    Jan 2006
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Angry QTextCharFormat::setAnchor

    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!

    Qt Code:
    1. cur_format = currentCharFormat();
    2. cur_format.setAnchor(true);
    3. cur_format.setAnchorHref(text);
    4. cursor.mergeCharFormat(cur_format);
    5. mergeCurrentCharFormat(cur_format);
    6. QString text_all(toHtml());
    7. setHtml(text_all);
    To copy to clipboard, switch view to plain text mode 
    Last edited by ccf_h; 30th November 2008 at 18:06.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.