[PyQt] QWebEngineView triggerPageAction segfaults

Florian Bruhin me at the-compiler.org
Thu Dec 8 13:29:35 GMT 2016


Hey,

* Rembrand at daxLAB <rembrand at daxlab.com> [2016-12-08 12:12:12 +0100]:
> I can use the triggerPageAcrion from QWebEngineView for some actions
> but not for all. Selecting and deselecting content works as well as
> refresh/reload  BUT everything related to an image like the actions: 
> 
>   QWebEnginePage::CopyImageToClipboard
>   QWebEnginePage::CopyImageUrlToClipboard
>   QWebEnginePage::DownloadImageToDisk
> 
> results in a segfault when executed.

Those are intended to be used with a context menu opened.

To be fair, they should probably just print a qWarning and do nothing
instead of segfaulting, but you'd need to report that in Qt's
bugtracker: https://bugreports.qt.io/

> If anybody knows a method to copy an image from QWebEngineview to
> the clipboard (or even download) without a segfault I would be very
> happy.

If it's already open, I wonder if QWebEngineView::toHtml or
toPlainText would give you something useful.

If not, you could also re-download it:

- Maybe the SavePage action does something sensible
- Or use a QNetworkAccessManager to download it independendly from
  QtWebEngine
- Some new API will also soon be added to trigger custom downloads:
  https://codereview.qt-project.org/#/c/173894/

> Is it possible that this is not implemented in PyQt5?

PyQt is just a wrapper over what Qt provides ;)

Florian

-- 
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20161208/06b74455/attachment.sig>


More information about the PyQt mailing list