| 101 | } |
| 102 | |
| 103 | void ExpandAnimator::expandOut() |
| 104 | { |
| 105 | // |
| 106 | // Прерываем выполнение, если клиент хочет повторить его |
| 107 | // |
| 108 | if (isAnimated() && isAnimatedBackward()) return; |
| 109 | setAnimatedBackward(); |
| 110 | |
| 111 | // |
| 112 | // Определим стартовые и финальные позиции для декораций |
| 113 | // |
| 114 | QRect startExpandRect = widgetForFill()->rect(); |
| 115 | QRect finalExpandRect = m_expandRect; |
| 116 | |
| 117 | // |
| 118 | // Позиционируем декораторы |
| 119 | // |
| 120 | m_decorator->resize(widgetForFill()->size()); |
| 121 | m_decorator->move(0, 0); |
| 122 | m_decorator->hide(); |
| 123 | m_decorator->grabExpandRect(); |
| 124 | m_decorator->show(); |
| 125 | m_decorator->raise(); |
| 126 | |
| 127 | // |
| 128 | // Анимируем виджет |
| 129 | // |
| 130 | if (m_animation->state() == QPropertyAnimation::Running) { |
| 131 | // |
| 132 | // ... если ещё не закончилась предыдущая анимация реверсируем её |
| 133 | // |
| 134 | m_animation->pause(); |
| 135 | m_animation->setDirection(QPropertyAnimation::Backward); |
| 136 | m_animation->resume(); |
| 137 | } else { |
| 138 | // |
| 139 | // ... если предыдущая анимация закончилась, запускаем новую анимацию |
| 140 | // |
| 141 | m_animation->setEasingCurve(QEasingCurve::InOutQuart); |
| 142 | m_animation->setDirection(QPropertyAnimation::Forward); |
| 143 | m_animation->setStartValue(startExpandRect); |
| 144 | m_animation->setEndValue(finalExpandRect); |
| 145 | m_animation->start(); |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | bool ExpandAnimator::eventFilter(QObject* _object, QEvent* _event) |
| 150 | { |
nothing calls this directly
no test coverage detected