Qt World Summit: Register Today!

activate and deactivate a gif

  • hello
    I want when I press a button I activate the gif and when I press another button the gif will be stopped.
    The probleme is when I press to reactivate the gif for the second time the application crashes you find if attached my code:
    QMovie *movie=new QMovie(":/images/foo.gif");

    //the first button
    if (!movie->isValid())
    // Something went wrong :(

    //second button

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Are you deleting your movie object at some point ?
    Did you try to run your application through a debugger ?

Log in to reply