Hi, everyone!

So, how can I make QLabel widget,that contains image, save its centr,
when I change geometry.(just making image bigger, when the mouse is over QLabel
from 64x64 to 128x128)


Thanks for your help!

This is the code, that I use:

Qt Code:
  1. void MainWindow::label_hover()
  2. {
  3. QPropertyAnimation *animation = new QPropertyAnimation(ui->label, "geometry");
  4. animation->setDuration(600);
  5. animation->setStartValue(QRect(390,70, 64, 64));
  6. animation->setEndValue(QRect(390, 70, 128, 128));
  7. animation->setEasingCurve(QEasingCurve::OutCubic);
  8. animation->start();
  9. }
To copy to clipboard, switch view to plain text mode