Important: Please read the Qt Code of Conduct -

Is there an easy way to copy a QWebFrame?

  • What I have at the moment is a QWebPage that shows the book contents of an EPUB file.

    I want to add 'Search' javascript function to find all occurances of that word/phrase and compile a list of the search result, but I don't want the process to affect the webview.

    So what I'm thinking is to make a copy of the original webview and do all the dirty work there.

    I could always load the EPUB contents from the file again into a new QWebView, but that could take a while so I'm looking for some kind of alternative.

    Here's what I've been doing:

    1. Realized that 'copying' a Q_OBJECT is not a recommended practice.
    2. Looked into 'Implicit Sharing' but didn't really understand the concept.
    3. Tried to use QWebFrame::toHtml() and QWebFrame::setHtml() to copy the contents
    • which failed because the contents seemed to get trauncated somewhere along the line

    Any suggestions/solutions?

Log in to reply