Qt World Summit: Register Today!

Generating .html files from qt

  • Hey all,

    I have made a lot of progress with my web browser, and I was wondering if there was a way to generate .html files in qt. I would like all the 'history' and 'bookmarks' to be written to a .html file that is stored on the computer. when I click the view history/bookmarks button, I want to load the history.html/bookmarks.html files into a webview.

    ok so my question summarized:

    1. create a .html file on local computer.
    2. constantly write search history to file.
    3. view file in QWebView.

    as a secondary, more advanced question: is it possible to generate the 'bookmarks.html' on a server so that your bookmarks are accessible from any computer.

    Thanks for your help!

  • Qt Champions 2017

    Atleast according to my knowledge there is no automated way of generating the html files. You need write manually(hand-code) using file operations or XML Document structure. You need to hand-code everything to look like HTML file.

    There is no direct way to dump the bookmarks.html file on to server. You need to write you own way of transferring the file to right location on the server.

  • Ok, what would a code to generate html files look like?

  • Have a look at QTextDocument::toHtml

  • Thanks a ton! Ill get on that right away!

Log in to reply