Results 1 to 4 of 4

Thread: Can't display .jpg,.jpeg file in my QT app

  1. #1
    Join Date
    Apr 2007
    Posts
    6
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Question Can't display .jpg,.jpeg file in my QT app

    Hi all,

    I am loading a .jpg file in my QT application and displaying it on paintEvent() of the app.
    When i run this app on my machine having QT VS 2003.NET integrated is installed, it works just fine.
    But when i run it in a fresh machine Windows XP where QT is not installed, i doesn't show me .jpg file.

    Can anybody tell me whats wrong i have done????

    Note:
    1. I have added QtCore4.dll, QtGui4.dll, and qjpeg1.dll.
    2. I tried to use "qjpeg1.dll" by placing it in current app directory and also in "CurrentDir\plugins\imageformats" but this .dll doesn't get loaded by Windows.
    3. I also loaded this .dll after user opens a .jpg file. I can see that dll got loaded but nothing happens.
    Anyways i suppose that this "qjpeg1.dll" should be loaded automatically when it is required but its not happening in my case.

    I know that this dll is the only culprit but i don't know what i have to do.

    i also create a qt.conf file in which i wrote:

    [Paths]
    Prefix = .\

    but it doesn't help.


    i got hint to do this from this link.
    http://lists.trolltech.com/qt-intere.../msg00672.html

    May be i am not able to understand what has been said.
    Can please somebody tell me what i should do to make it work.


    Any help would be appreciated.
    Thanks in advance.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't display .jpg,.jpeg file in my QT app

    Where are you loading the image from? From a resource( qrc ), or from an external location (hard drive) ?

  3. #3
    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: Can't display .jpg,.jpeg file in my QT app

    The plugin should be placed in "Currentdir/imageformats" (without "plugins").

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

    KrecikNH (24th November 2011), Shalabh (23rd April 2007)

  5. #4
    Join Date
    Apr 2007
    Posts
    6
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Can't display .jpg,.jpeg file in my QT app

    Thnx a lot.....
    Putting qjpeg1.dll in below given dir works for me.............
    "Currentdir/imageformats" (without "plugins")

    Thnx again.......

Similar Threads

  1. Replies: 8
    Last Post: 18th March 2011, 12:27
  2. Sending Binary File with QFTP
    By nbkhwjm in forum Newbie
    Replies: 2
    Last Post: 7th March 2007, 19:10
  3. How to Read and display BMP image using QT
    By agsrinivasan in forum Qt Programming
    Replies: 3
    Last Post: 29th January 2007, 08:14
  4. How To Extract A File
    By deekayt in forum General Programming
    Replies: 7
    Last Post: 5th December 2006, 19:27
  5. How to display a file in the textBrowser
    By deekayt in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2006, 20:47

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.