[Interest] Qt WebEngine: how to handle unsupported content?

Jason Dolan jason at pcc.com
Thu Oct 15 21:19:41 CEST 2015


My company is porting or project from Qt4.8.6 to Qt5.5.1. In doing so, we are
also porting from QWebkit to QWebEngine since QWebkit is deprecated.

I'm finding that QWebEngine is very limited in it's ability to deal with
various files. In Qt4.8.6, I was able to handle most file content with
QWebPage's unsupportedContent SIGNAL.

I see that QWebEngine has QWebEngineProfile, which in turn has the
downloadRequested SIGNAL. This doesn't handle all cases however. In fact,
it's not extremely clear to me what cases it handles and what it doesn't.

Using the Browser example in the Qt's exmaple directory I tried out these
URLS:

Content-Disposition: inline; filename="foo.pdf"
http://greenbytes.de/tech/tc2231/inlwithasciifilenamepdf.asis <http://greenbytes.de/tech/tc2231/inlwithasciifilenamepdf.asis>
-- Does nothing

Content-Disposition: attachment; filename="foo.html"
http://greenbytes.de/tech/tc2231/attwithasciifilename.asis <http://greenbytes.de/tech/tc2231/attwithasciifilename.asis>
--Triggers downloadRequested(). Yay!

<object data=“test.pdf" type="application/pdf”></object>
http://plugindoc.mozdev.org/testpages/pdf.html <http://plugindoc.mozdev.org/testpages/pdf.html>
--Does nothing

Direct access to pdf file
http://plugindoc.mozdev.org/testpages/test.pdf <http://plugindoc.mozdev.org/testpages/test.pdf>
--Does nothing

Direct access to a rtf file
http://thewalter.net/stef/software/rtfx/sample.rtf <http://thewalter.net/stef/software/rtfx/sample.rtf>
--Triggers downloadRequested(). Yay!

Is there a way I can handle these cases?
If not in 5.5.1, does anyone know if 5.6 will have support?

--
Jason Dolan
Software Developer
PCC
Control Your Future.

800-722-7708
jason at pcc.com <mailto:jason at pcc.com>
www.pcc.com <http://www.pcc.com/>
twitter.com/pccvt



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151015/7dc933fa/attachment.html>


More information about the Interest mailing list