【发布时间】:2014-09-22 09:24:16
【问题描述】:
当用户点击显示对话框时,有什么方法可以添加对话框从小尺寸到最大尺寸的效果! 就像在 iphoto 中,当我们请求打开一个对话框时,它以同样的方式出现!!! 我正在使用的代码是:
fade_effect = new QGraphicsOpacityEffect(this);
this->setGraphicsEffect(fade_effect);
animation = new QPropertyAnimation(fade_effect, "opacity");
animation->setEasingCurve(QEasingCurve::InOutQuad);
animation->setDuration(5000);
animation->setStartValue(1);
animation->setEndValue(0.01);
animation->start(QPropertyAnimation::DeleteWhenStopped);
this->setWindowOpacity(0.5);
//this->hide();
//QDialog::reject();
它在隐藏的情况下不起作用。
【问题讨论】:
-
看看
QPropertyAnimation是否适合你。 -
您添加的代码示例与您的要求存在争议。如果您想获得其他信息,请提出新问题。