0
votes

I am trying to deploy an application that uses a pic.gif as an AnimatedImage. The code works for debug but not for release.

I have the qml files and main.cpp in a folder called demo. I have the pictures in a subfolder called images. I have added all qml and pic files as resources but get this error when executing the release version from QtCreator: QML AnimatedImage: Error Reading Animated Image File qrc:///images/Bear_claw.gif.

Here is qml.qrc:

<qresource prefix="/">
    <file>demo.qml</file>
    <file>AnimatedEngine.qml</file>
    <file>images/Bear_claw.gif</file>
</qresource>

Here is AnimatedEngine.qml: ` import QtQuick 2.1

Rectangle {
    color: backgroundcolor
    focus: activeFocus

    AnimatedImage {
        id: sprite
        anchors.centerIn: parent
        source: "images/Bear_claw.gif"
    }
}

I know this is a novice issue and I have tried many of the recommended fixes I found here and in other places like adding an alias in the .qrc file and changing the source to have qrc:///, images/images/pic.gif etc but none of the recommendations solve the problem. I think it has more to do with an environment variable setting or something. I am running Qt5.6.0/5.6/mingw49_32.

Thanks in advance for any help you can give me.

1

1 Answers

0
votes

Every time you modify any of your .qrc file you need to call qmake. So you have to do this almost every time you add or remove files from a project. You problably have done it for Debug but forgot to do this for Release. Simply choose Build -> run qmake and then try to run your project.

enter image description here