[PyQt] QtWebKit and WebActions

Christoph Burgmer chrislb at gmx.de
Sat Jan 10 13:21:33 GMT 2009


QtWebKit has some functionality embedded in WebActions[1] which can be 
accessed using
    virtual void triggerAction ( WebAction action, bool checked = false )

This already allows me to copy content to the clipboard easily:

    KStandardAction.copy(
        lambda: self.webView.triggerPageAction(QWebPage.Copy),
        self.actionCollection())

Well, this is neat but I am looking for functionality that can not be built by 
other means like "select all" and "find from beginning".

For "select all" I then tried to trigger
    QWebPage.MoveToStartOfDocument ("Move the cursor to the start of the 
document."), followed by
    QWebPage.SelectEndOfDocument ("Select to the end of the document.")

For find from the beginning of the document I just call 
    QWebPage.MoveToStartOfDocument

But none of this works. Why? Can anybody help me out here?
The Arora project seems to not use selectAll, at least I found nothing in 
there sources. Are there other places I could check?

Christoph

[1] http://doc.trolltech.com/4.4/qwebpage.html#WebAction-enum
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090110/9ab6b587/attachment.html


More information about the PyQt mailing list