Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, March 2007
QImageViewer Loads Jpgs But I Can't In My Application


Message 1 in thread

I can't get jpegs to load in my qt application, using qt 4.2.2 in 
MSVC7.1.  I have tried using Q_IMPORT_PLUGIN but I always get an 
external link error that I can't seem to resolve.  I used 
QImageReader::supported formats and jpg is NOT listed.  I also makde 
sure the qt jpg libraries are under /imageformats in my executable 
directory.  However, when I run the examples and demos the image viewer 
loads jpgs fine.  Looking at the image viewer code - it does NOTHING at 
all to configure itself for jpgs, gifs, or anything.  What is going on? 
  How can I load jpgs in my application?  Any help would be greatly 
appreciated.  Thanks,
Chris

PS - I think it's really absurd that Qt doesn't natively "just work" for 
jpg (and gif for that matter, the patents expired).  I shouldn't have to 
spend an entire day trying to resolve this problem.

--
 [ signature omitted ] 

Message 2 in thread

Hi,

> PS - I think it's really absurd that Qt doesn't natively "just work" for 
> jpg (and gif for that matter, the patents expired).  I shouldn't have to 
> spend an entire day trying to resolve this problem.

It just works as far as I know. Did you build Qt yourself? If so how did 
you configure it, is it a static version of Qt or a DLL?

Q_IMPORT_PLUGIN is useful only with static versions of Qt.

--
 [ signature omitted ] 

Message 3 in thread

Dimitri wrote:
> Hi,
> 
>> PS - I think it's really absurd that Qt doesn't natively "just work" 
>> for jpg (and gif for that matter, the patents expired).  I shouldn't 
>> have to spend an entire day trying to resolve this problem.
> 
> It just works as far as I know. Did you build Qt yourself? If so how did 
> you configure it, is it a static version of Qt or a DLL?
> 
> Q_IMPORT_PLUGIN is useful only with static versions of Qt.
> 
> -- 
> Dimitri

I didn't build qt myself, I'm using the commercial build of qt for 
vs2003.  I have read about configuring qt, but have not done anything 
yet.  How should I configure my qt build appropriately?
Chris

--
 [ signature omitted ] 

Message 4 in thread

> I didn't build qt myself, I'm using the commercial build of qt for
> vs2003.  I have read about configuring qt, but have not done anything
> yet.  How should I configure my qt build appropriately?

if you're using the binary distribution QT is configured to use shared
libraries (dlls) this should be fine and if you installed QT using the
installer, all image formats should be working out of the box (using
plugins). As Dimitri said, no need for Q_IMPORT_PLUGIN.

if in QImageReader::supported formats jpg is not listed, something is
missing from your Qt installation (namely the plugins, they should be in
%QTDIR%/plugins/imageformats - e.g. qjpeg1.dll)

i'd suggest running the installer again.

Cheers,
Peter


--
 [ signature omitted ]