Results 1 to 2 of 2

Thread: Inserting links in QTextDocument

  1. #1

    Default Inserting links in QTextDocument

    I can't seem to find anything on this anywhere, but it appears as though links are not supported QTextDocument writer when writing in odf.

    Qt Code:
    1. QApplication a(argc, argv);
    2.  
    3. QTextDocument document;
    4. QTextCursor cursor(&document);
    5.  
    6. cursor.insertHtml("<a href=\"http://google.com\">Link</a>");
    7.  
    8. QTextDocumentWriter writer("test.odf", "odf");
    9. writer.write(&document);
    10.  
    11. QTextDocumentWriter writer2("test.html", "html");
    12. writer2.write(&document);
    13.  
    14. return a.exec();
    To copy to clipboard, switch view to plain text mode 

    When I run this, the test.html has a link that you can click. In the odf file, however, the text is just formatted ( blue and underlined ) and not a true link. And ctrl+click does not do anything. Does this mean it's simply not supported? Or is there something I'm missing? Thank you.

  2. #2

    Default Re: Inserting links in QTextDocument

    Nobody has tried this? I feel I must be doing something wrong as if this was a problem in odf it would be documented, but I can't seem to find any such documentation. I would really appreciate any insight, even if it's just "hey I tried the code and I have the same problem!". Thank you.

Similar Threads

  1. Inserting Record
    By Nefastious in forum Newbie
    Replies: 3
    Last Post: 20th October 2009, 04:28
  2. Inserting PDF metadata
    By Randria in forum Qt Programming
    Replies: 2
    Last Post: 18th May 2009, 10:18
  3. Inserting Table
    By dreamer in forum Qt Programming
    Replies: 5
    Last Post: 16th May 2008, 10:10
  4. Need Links fot QT4.2.3
    By nirup in forum Qt Tools
    Replies: 1
    Last Post: 14th May 2007, 10:39

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.