PDA

View Full Version : View decoration role empty on Windows



sebr
28th October 2007, 02:08
Hi,
I am trying to write a small cross platform application which shows an
icon view display of images. These images are loaded in a thread since
they are quite large. The loading thread simply sends a thumbnailed
QImage in a signal which is observed by my Model.

My subclass of QAbstractItemModel::data() returns QIcon( thumbnail )
for the DecorationRole to display the image on the View.

This works perfectly fine on Linux, but Windows shows no decoration,
simply the associated text returned by DisplayRole.

I suppose the real problem is that I don't have a windows build
environment, but I'm passing off the code to someone else to build.

Using Qt 4.3

jpn
28th October 2007, 08:59
Which image format? Perhaps his Qt was built without support for such image format. Give PNG images a try..

sebr
28th October 2007, 10:55
Bingo. PNG files are loaded without a problem. Thanks. I'll have to look into how to compile Qt with alternate image format support.

sebr
28th October 2007, 10:58
Which image format? Perhaps his Qt was built without support for such image format. Give PNG images a try..

Although it is strange since the QImage documentation (http://doc.trolltech.com/4.3/qimagereader.html#supportedImageFormats) explicitly has jpg image support out of the box.

What went wrong? Is this a windows specific thing?

jpn
28th October 2007, 11:03
I think JPG support is compiled as a plugin by default. Try placing the "qjpeg4.dll" -plugin into an "imageformats" -subdirectory into the directory where the application is located in:


app\app.exe
app\imageformats\qjpeg4.dll

wysota
28th October 2007, 11:44
We have a FAQ entry (http://www.qtcentre.org/forum/faq.php?faq=qt_general_category#faq_qt_missing_ima ges) for that :) Just letting you know...