Solved Prevent QDialog from hiding
-
Hello,
How can I prevent QWidget::hide from being called from within done? I want to implement fade in/out animation when the widget is created/destroyed, and right now it's being hidden immediately.
void QDialog::done(int r) { Q_D(QDialog); d->hide(r); d->finalize(r, r); }
-
Hi
It's virtual so you can just override it.
https://doc.qt.io/qt-5/qdialog.html#done -
Hi
It's virtual so you can just override it.
https://doc.qt.io/qt-5/qdialog.html#done -
@mrjj Thanks. Also I had to override QDialog::open instead of overriding QDialog::exec, otherwise it wouldn't return until hide is called.
-
Hi
Thanks you for updating.
What will you use for the animation? (if i may ask)
Q animation classes and setWindowOpacity ?
There is also QGraphicsOpacityEffect. -
@mrjj I'm using QPropertyAnimation on a windowOpacity property.
I shared the code in the answer here. I also added dark overlay effect.