We came up with a weird problem. We have a Widget with a few buttons, when clicking on one the widget should expand down, showing a progress bar.
The thing is that if we do:
void frmCreateKeys::slotGenerateKey()
{
if (!validatePage())
return;
/// Animate the frame, to grow and show the progress bar
QPropertyAnimation animationFrame(this, "geometry");
animationFrame.setDuration(300);
animationFrame.
setEndValue(QRect(this
->pos
().
x()+7,this
->pos
().
y()+30, this
->width
(), this
->height
() + 60));
animationFrame.start();
ui->msgLabel->setVisible(true);
ui->pBar->setVisible(true);
this->repaint();
emit createKey(); // a long task
}
void frmCreateKeys::slotGenerateKey()
{
if (!validatePage())
return;
/// Animate the frame, to grow and show the progress bar
QPropertyAnimation animationFrame(this, "geometry");
animationFrame.setDuration(300);
animationFrame.setEndValue(QRect(this->pos().x()+7,this->pos().y()+30, this->width(), this->height() + 60));
animationFrame.start();
ui->msgLabel->setVisible(true);
ui->pBar->setVisible(true);
this->repaint();
emit createKey(); // a long task
}
To copy to clipboard, switch view to plain text mode
it doesnt animate, meaning the widget doesnt expand down. Now if we change the animationFrame variable to be a pointer, then everything works fine.
/// Animate the frame, to grow and show the progress bar
QPropertyAnimation *animationFrame = new QPropertyAnimation (this, "geometry");
/// Animate the frame, to grow and show the progress bar
QPropertyAnimation *animationFrame = new QPropertyAnimation (this, "geometry");
To copy to clipboard, switch view to plain text mode
Any ideas why this could be happening?
Bookmarks