| 378 | } |
| 379 | |
| 380 | void MyGraphicsVexItem::hoverInEffect(){ |
| 381 | stopAnimation(); |
| 382 | QTimeLine *timeLine = new QTimeLine(300, this); |
| 383 | timeLine->setFrameRange(0, 100); |
| 384 | QEasingCurve curve = QEasingCurve::OutBounce; |
| 385 | qreal baseRadius = this->rect().width() / 2; |
| 386 | qreal difRadius = 1.25 * radius - baseRadius; |
| 387 | connect(timeLine, &QTimeLine::frameChanged, [=](int frame){ |
| 388 | qreal curProgress = curve.valueForProgress(frame / 100.0); |
| 389 | qreal curRadius = baseRadius + difRadius * curProgress; |
| 390 | this->setRect(QRectF(center.x() - curRadius, center.y() - curRadius, curRadius * 2, curRadius * 2)); |
| 391 | |
| 392 | }); |
| 393 | curAnimation = timeLine; |
| 394 | startAnimation(); |
| 395 | } |
| 396 | |
| 397 | void MyGraphicsVexItem::hoverOutEffect(){ |
| 398 | stopAnimation(); |
nothing calls this directly
no outgoing calls
no test coverage detected