Release dont show jpeg-Images



  • Hello guys,

    i have a little problem with my projekt.
    If i compile it into a release project, it dont shows any jpeg-images anymore.
    I used Google but.. all solution dont works for me. Maybe im just a little bit stupid, but I hope you can help with this "little problem". :(

    Code for images:
    @
    palette->setBrush(QPalette::Background,(new QBrush((new QPixmap(":/data/imageIntro.jpeg")))));
    @
    and
    @
    QPixmap preview = QPixmap(":/data/preview.jpeg","JPEG");
    @

    My directory:
    @
    /MyApp/MyApp.exe
    /MyApp/data.qrc
    /MyApp/Qt5Core.dll
    /MyApp/Qt5Widgets.dll
    /MyApp/allotherneededDLL
    /MyApp/platforms/qwindows.dll
    /MyApp/imageformats/qjpeg.dll
    @

    My .pro-File:
    @
    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = MyApp
    TEMPLATE = app

    SOURCES += main.cpp
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui

    RESOURCES +=
    data.qrc

    VERSION = 1.0.0
    (...)
    

    @

    My Qt-Version:
    @
    Qt 5.2 MSVC10 32Bit
    @


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    The directory structure you should have is described in "the Windows deployment guide":http://qt-project.org/doc/qt-5.0/qtdoc/deployment-windows.html

    At first sight, you should only need to move the imageformats folder in plugins



  • Sorry for this. I tried and its still not working. :(
    Do you need more information?


  • Lifetime Qt Champion

    Did you move imageformats in plugins or just qjpeg.dll ?



  • Hi,

    jepp, I move imageformats to plugins.

    Its looks like:

    @
    /MyApp/MyApp.exe
    /MyApp/data.qrc
    /MyApp/Qt5Core.dll
    /MyApp/Qt5Widgets.dll
    /MyApp/allotherneededDLL
    /MyApp/platforms/qwindows.dll
    /MyApp/plugins/imageformats/qjpeg.dll
    @

    But its still not works. Im sure there is a simple solution for this. Do you need more information? What should I do? I created the release folder many times, and put the .exe in the new folder. Same problem. Only on debug-mode the images are show.

    Its the better solution to use the path to the images instead of .qrc-File?


  • Lifetime Qt Champion

    The qrc file is not needed, it's used to build your resources in your executable.

    Does it show the image properly if you run the release build from Qt Creator ?


  • Moderators

    Hi,

    Use /MyApp/imageformats/ instead of /MyApp/plugins/imageformats/

    See http://stackoverflow.com/questions/19710879/visual-studio-qt5-plugins-not-working-on-release/19761382#19761382


  • Lifetime Qt Champion

    @ JKSH If I saw the first post correctly, it's what kursukani was doing


  • Moderators

    [quote author="SGaist" date="1387921977"]@JKSH If I saw the first post correctly, it's what kursukani was doing[/quote]Whoops, I missed that!

    The original folder layout is correct.

    [quote author="kursukani" date="1387829578"]Only on debug-mode the images are show.[/quote]Can you please confirm that you have deployed the correct DLL?

    • qjpegd.dll is for Debug mode
    • qjpeg.dll is for Release mode

    [quote author="kursukani" date="1387829578"]Its the better solution to use the path to the images instead of .qrc-File?[/quote]They are both supposed to be equally valid solutions. However, you can give it a try and see if it makes a difference.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.