当用户点击以显示对话框时,是否有任何方法可以添加效果,如对话框以小尺寸显示最大尺寸! 当我们要求打开一个对话框时,就像在iphoto中一样,它以相同的方式出现! 我使用的代码是:如何在显示/隐藏期间在QTDialog中添加效果?
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'(http://qt-project.org/doc/qt-4.8/qpropertyanimation.html)将用于工作您。 – thuga 2014-09-22 09:34:30
您添加的代码示例对您所问的内容有争议。如果你想获得另一个信息,请提出一个新问题。 – Ezee 2014-09-24 08:31:28