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:
void MainWindow::label_hover()
{
QPropertyAnimation *animation = new QPropertyAnimation(ui->label, "geometry");
animation->setDuration(600);
animation
->setStartValue
(QRect(390,
70,
64,
64));
animation
->setEndValue
(QRect(390,
70,
128,
128));
animation->setEasingCurve(QEasingCurve::OutCubic);
animation->start();
}
void MainWindow::label_hover()
{
QPropertyAnimation *animation = new QPropertyAnimation(ui->label, "geometry");
animation->setDuration(600);
animation->setStartValue(QRect(390,70, 64, 64));
animation->setEndValue(QRect(390, 70, 128, 128));
animation->setEasingCurve(QEasingCurve::OutCubic);
animation->start();
}
To copy to clipboard, switch view to plain text mode
Bookmarks