PDA

View Full Version : jpeg support in qt 4.6.1


cnavarro
03-14-2010, 01:30 PM
Hi

I'm writting an app based in qt 4.6.1 ( not 4.6.2 yet )
and I'm having trouble when trying to load jpeg files from Qt, actually
when I query for the supported image formats in the n900 i get the following:

("bmp", "pbm", "pgm", "png", "ppm", "xbm", "xpm")

The code to query is :


qDebug() << QImageReader::supportedImageFormats();

and I'm loading the pixmap with

QByteArray data = reply->readAll();
QPixmap pix;

qDebug() << QImageReader::supportedImageFormats();

if ( pix.loadFromData(data,""))//extension_.toLatin1().data()) )
{
icon_ = QIcon(pix);
}

It works fine for pngs but not in jpeg. It works fine in the emulator of the sdk or with the same sources compiles in windows.

Do I need to do something to create a QPixmap from jpeg in the N900?

Regards

kwotski
03-14-2010, 02:13 PM
not sure how helpful this will be, but..

I found recently that when deploying a (4.6.2) qt app onto windows, to get jpeg support I needed to include an 'imageformats' subdirectory from where the qt runtime dlls directory was, with the jpeg dll in it.

I would try googling on qt, jpeg, mageformats, to see if an analogous procedure is needed for the N900.

cnavarro
03-14-2010, 03:11 PM
found it. some file formats are plugins to qt,

As I'm deplotying manually the so files for Qt 4.6 i needed to deploy plugins/imageformats also to the device and export QT_PLUGIN_PATH