0

我想要一个带有单击事件的按钮,该按钮可以打开带有动画的框架。在我升级到 QT 5 Beta 2 之后,框架刚好停在最后,留下一条细线。

之前-期间-之后

我有一个 QProperty 动画,每次单击按钮时,我都会这样做:

if(this->isOpen) {
    this->animation->setStartValue(this->openRect);
    this->animation->setEndValue(this->closedRect);
} else {
    this->animation->setStartValue(this->closedRect);
    this->animation->setEndValue(this->openRect);
}
this->isOpen = !this->isOpen;

this->animation->start();

openRect(300x300) 和closedRect(0x100) 在 init 中设置并且永远不会更改。

有人知道发生了什么吗??

编辑

当我在窗口外单击时,小线消失了

4

0 回答 0