Results 1 to 6 of 6

Thread: View decoration role empty on Windows

  1. #1
    Join Date
    May 2006
    Posts
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question View decoration role empty on Windows

    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

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: View decoration role empty on Windows

    Which image format? Perhaps his Qt was built without support for such image format. Give PNG images a try..
    J-P Nurmi

  3. #3
    Join Date
    May 2006
    Posts
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Thumbs up Re: View decoration role empty on Windows

    Bingo. PNG files are loaded without a problem. Thanks. I'll have to look into how to compile Qt with alternate image format support.

  4. #4
    Join Date
    May 2006
    Posts
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: View decoration role empty on Windows

    Quote Originally Posted by jpn View Post
    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 explicitly has jpg image support out of the box.

    What went wrong? Is this a windows specific thing?

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: View decoration role empty on Windows

    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
    J-P Nurmi

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: View decoration role empty on Windows

    We have a FAQ entry for that Just letting you know...

  7. The following 2 users say thank you to wysota for this useful post:

    jpn (28th October 2007), THRESHE (5th December 2007)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.