Reputation: 1978
Here is the code.
QPropertyAnimation *animation3 = new QPropertyAnimation (ui->modifyButton, "geometry");
animation3->setDuration(1000);
animation3->setStartValue(QRect(20, 120, 141, 20));
animation3->setStopValue(QRect(20, 70, 141, 20));
animation3->start();
I need the application to automatically determine the "Y" coordinate of modifyButton as it is not fixed and is changing. So how can I do something like this.
int y = get_y_coordinate_somehow();
animation3->setStartValue(QRect(20, y, 141, 20));start();
Upvotes: 2
Views: 132