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

Jason Dolan jason at pcc.com
Fri Oct 16 14:31:01 CEST 2015


Maybe you’re right.  I assumed it had more to do with the method of handing off the data, not the mime-type.  I’ll add my comments to that bug.

--
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



> On Oct 15, 2015, at 4:28 PM, Allan Sandfeld Jensen <kde at carewolf.com> wrote:
> 
> On Thursday 15 October 2015, Jason Dolan wrote:
>> 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 <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>
>> <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>
>> <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>
>> <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>
>> <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?
> 
> Sounds like https://bugreports.qt.io/browse/QTBUG-48764 <https://bugreports.qt.io/browse/QTBUG-48764> without having 
> investigated I would guess Chromium thinks it is a supported mime-type though 
> we don't support the PDFium PDF viewer.
> 
>> 
>> --
>> Jason Dolan
>> Software Developer
>> PCC
>> Control Your Future.
>> 
>> 800-722-7708
>> jason at pcc.com <mailto:jason at pcc.com> <mailto:jason at pcc.com <mailto:jason at pcc.com>>
>> www.pcc.com <http://www.pcc.com/> <http://www.pcc.com/ <http://www.pcc.com/>>
>> twitter.com/pccvt <http://twitter.com/pccvt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151016/45117e1a/attachment.html>


More information about the Interest mailing list