Important: Please read the Qt Code of Conduct -

[SOLVED] How to cache .gif files using QLabel & QMovie ?

  • Hi, I am working on some sort of Tower Defense Game
    It's working great except minors things.


    Now I try to increase the monster spawning amount.

    But already with a number of 40 it starts to lag too much.
    So I need to cache the one monster.gif

    I am using simply a QLabel and a QMovie to display them

    @ //MONSTER
    QLabel *monster[400];
    QMovie *monster_movie[400];@

    @ for (int i=0; i<3; i++) {

    // Monster [X]

    monster[i]= new QLabel(widget_map_background);
    monster[i]->setStyleSheet("background-image: url( )" );

    monster_movie[i] = new QMovie("monsters/SlugGunner_walk.gif");

    How can I do this?
    thanks for any help!


    Okay guys, you will never guess what caused the big performance issue.

    somewhere I placed accidentally the code


    and that caused so big performance issues O.O
    so no need for cache anything.

    holy pussycat^^

Log in to reply