Results 1 to 5 of 5

Thread: Gifs don't load in QTextEdit under windows

  1. #1
    Join Date
    Jul 2007
    Location
    Cluj Napoca, Romania
    Posts
    15
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Exclamation Gifs don't load in QTextEdit under windows

    My project uses a similar method in animating gif images in a QTextEdit to this example: http://wiki.qtcentre.org/index.php?t...n_in_QTextEdit

    The difference is that I had to load many gif images, so instead of calling setLineWrapColumnOrWidth(lineWrapColumnOrWidth()); to reload the QTextEdit document in every animation I declared a slot and connected it to a QTimer.

    It works great under my linux, and it also works under my windows.I have Qt 4.4.1 installed.The problem is that if I send my app to a windows user who doesn't have qt4 installed (not sure about this, maybe doesn't have some other dll) the gifs won't load.White image icons appear instead of animations.
    The problem occurs only in the case of gifs.Pngs load perfectly.

    I convinced one of my friends to run the app with gdb to see if he gets any errors about missing dlls or other things that could point me in the right direction, but none were found.

    I also tried loading it statically with Q_IMPORT_PLUGIN(qgif) (added QTPLUGIN += qgif to the project file too), but it complained about not finding qgif.I do have libqgif.a and qgif4.dll in plugins/imageformats, as part of Qt 4.4.1.

    I copied to the folder containing the exe file of my app the following dlls:
    mingw10.dll, QtCore4.dll, QtGui4.dll,QtNetwork4.dll.
    Every windows user who tested the app runs XP, haven't tried under vista.

    What am I doing wrong?
    Thanks.
    May the source be with you!

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Gifs don't load in QTextEdit under windows

    Did you try copying the gif lib/dll into ur application directory ?
    Qt doesnt support gif directly but uses plugins for that.
    You can find the necessary dlls under QT_Direcory/4.x.y/plugins/imageformats directory.
    Hope this will solve ur problem

  3. #3
    Join Date
    Jul 2007
    Location
    Cluj Napoca, Romania
    Posts
    15
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Gifs don't load in QTextEdit under windows

    Quote Originally Posted by aamer4yu View Post
    Did you try copying the gif lib/dll into ur application directory ?
    Qt doesnt support gif directly but uses plugins for that.
    You can find the necessary dlls under QT_Direcory/4.x.y/plugins/imageformats directory.
    Hope this will solve ur problem
    Yes I did.
    I copied libqgif4.a and qgif4.dll in the folder where the exe is.
    I'll try making a plugins/imageformats directory tree in my application's folder, and copying them there.

    Anyway, thanks for replying.
    May the source be with you!

  4. #4
    Join Date
    Jul 2007
    Location
    Cluj Napoca, Romania
    Posts
    15
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Gifs don't load in QTextEdit under windows

    I was able to reproduce the problem with running my app in Wine.
    I tried copying those dlls into both places.
    No results.No errors.The gifs simply don't load.
    I made sure the paths were right, the gif images are stored in resources.
    And both versions were compiled with the same qrc file.

    Any ideas ?
    May the source be with you!

  5. #5
    Join Date
    Jul 2007
    Location
    Cluj Napoca, Romania
    Posts
    15
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Smile Re: Gifs don't load in QTextEdit under windows

    I hate triple posting but I figured it out.
    It works now.
    I added QCoreApplication::addLibraryPath("."); to main.cpp and made an imageformats subdirectory in the application folder, where I copied the two plugins: libgif4.a and qgif4.dll.

    It works.Thanks.
    May the source be with you!

Similar Threads

  1. Load HTML to QTextEdit
    By Gamalof in forum Qt Programming
    Replies: 2
    Last Post: 5th July 2008, 18:08

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.