How to animate hiding/showing of a QVBoxLayout widget
问题 I have this horizontal layout of a QWidget subclass using QHBoxLayout : I would like the top widget to hide/show in sliding animation. I have read this article, and I know that I have to use QPropertyAnimation . Frankly, not a good Google result come up. Any suggestion for code example or maybe link to an article? 回答1: You can change the maximumHeight property of the top widget in an animation. For hiding the top widget : QPropertyAnimation *animation = new QPropertyAnimation(ui->topWidget,