| 57 | } |
| 58 | |
| 59 | void PageLabelWidget::show() |
| 60 | { |
| 61 | if (this->pos().y() <= 0 && animation->state() != QPropertyAnimation::Running) { |
| 62 | auto parent = dynamic_cast<QWidget *>(this->parent()); |
| 63 | if (parent == nullptr) { |
| 64 | return; |
| 65 | } |
| 66 | |
| 67 | QWidget::show(); |
| 68 | // connect(animation,SIGNAL(finished()),this,SLOT(QWidget::hide())); |
| 69 | animation->disconnect(); |
| 70 | |
| 71 | animation->setStartValue(QPoint((parent->geometry().size().width() - this->width()), -this->height())); |
| 72 | animation->setEndValue(QPoint((parent->geometry().size().width() - this->width()), 0)); |
| 73 | animation->start(); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | void PageLabelWidget::hide() |
| 78 | { |