[Qt-interest] QtWebKit 4.5.0 doesn't load SVG or TIFF images

Nathan Carter nathancarter5 at gmail.com
Fri Mar 20 01:17:52 CET 2009


Dear Rush,

Statically linked executables can't use Qt plugins.  Does that address  
your issue?
http://doc.trolltech.com/4.5/deployment.html

Nathan


On Mar 19, 2009, at 7:29 PM, Rush Manbert wrote:

> On Mar 19, 2009, at 2:52 PM, Rush Manbert wrote:
>
>> [---- This first part duplicates an earlier post - same app, but
>> different problem ----]
>> My test platform is Mac OSX 10.5.6 with Xcode 3.1.2.
>>
>> I have a small web browser application that is a prototype for a much
>> more complicated web browser application. The simple version always
>> loads the same HTML. The web page that the HTML defines loads an
>> external CSS file, an external JavaScript file, and a number of
>> images, each in one of the supported image formats. The JavaScript
>> causes the images to move on the page, the CSS causes the div that
>> contains the images to have a purple background, and each image
>> includes text that identifies its format. This all makes it easy to
>> tell whether all of the content was loaded.
>>
>> Because of the way the complicated browser works, we implemented this
>> by deriving from QNetworkAccessManager and overriding its
>> createRequest() method. We also derived from QNetworkReply so that we
>> could override its readData() and bytesAvailable() methods, among
>> others.
>>
>> The createRequest() override instantiates our NetworkReply class and
>> gives it a pointer to the rendered HTML. The NetworkReply::readData()
>> method returns the HTML string in however many chunks are required.
>> The current implementation is a fairly short string, so it only gets
>> called once and it just returns the whole thing.
>>
>> I have been using qmake to read my .pro file and make Xcode projects.
>> I have tested this using Qt 4.4.3 and 4.5.0. Both of my Qt
>> installations use the -static configuration, so I am using static
>> libraries.
>>
>> [---- Here is the new stuff. ----]
>> The problem I am seeing is that neither the Qt 4.4.3 version, nor the
>> Qt 4.5.0 version loads the SVG or TIFF images. Both versions load  
>> BMP,
>> GIF, JPG, and ICO images.
>>
>> I have used my fixed HTML to write a web page that I can load with
>> Safari. It loads all 6 image types and the page acts as I expect. I
>> can also drag and drop all six image files onto Safari and they are
>> displayed correctly.
>>
>> In my program source, I have this:
>> Q_IMPORT_PLUGIN (qgif)
>> Q_IMPORT_PLUGIN (qico)
>> Q_IMPORT_PLUGIN (qjpeg)
>> Q_IMPORT_PLUGIN (qmng)
>> Q_IMPORT_PLUGIN (qsvg)
>> Q_IMPORT_PLUGIN (qtiff)
>>
>> and my .pro file looks like this:
>> CONFIG += qt debug
>> HEADERS += TestBrowser.h
>> SOURCES += TestBrowser.cpp
>>
>> QT += core network webkit svg
>> LIBS += /Users/rmanbert/temp/qt/plugins/imageformats/ 
>> libqgif_debug.a /
>> Users/rmanbert/temp/qt/plugins/imageformats/libqic
>> o_debug.a /Users/rmanbert/temp/qt/plugins/imageformats/
>> libqjpeg_debug.a /Users/rmanbert/temp/qt/plugins/imageformats/lib
>> qmng_debug.a /Users/rmanbert/temp/qt/plugins/imageformats/
>> libqsvg_debug.a /Users/rmanbert/temp/qt/plugins/imageformats/l
>> ibqtiff_debug.a
>>
>> You can see that it includes "svg" on the "QT +=" line, and also has
>> the full path to libqsvg_debug.a in the "LIBS +=" line.
>>
>> Does anyone have any ideas why these image types would not load?
>>
>> Thanks,
>> Rush
>
> I have now tested against 4.5.0 dylibs and that version DOES load all
> of the image types.
>
> Does anyone know how to enable this for static Qt?
>
> I might also add here that the static libs won't load flash content,
> but the dylibs do. I can't find an obvious Qt plugin for flash. Is
> there some way to get the static libraries to load flash content?
>
> - Rush
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list