Important: Please read the Qt Code of Conduct -

Memory leak in QPropertyAnimation

  • Hello,

    could you please help my with investivation. Why this part of code cased to a memory leak?

    QPropertyAnimation *animation = new QPropertyAnimation(ui->createAdv, "geometry");
    animation->setStartValue(QRect(0, -20, 60, 31));
    animation->setEndValue(QRect(0, 82, 200, 31));

  • Moderators

    looks good so far IMHO, as long as there are no console warnings and connect() returns true.

    btw. you can also do this to safe the connection of signals at all:

  • Hi,

    thanks, I'll try with DeleteWhenStopped.

  • Moderators

    why do you know there is a memory leak in first place?

  • I checked my application with Valgrind on Linux and it shows memory leaks. Also leaks observed by WindowsTaskManager while I run animation.

Log in to reply