MCPcopy Create free account
hub / github.com/Linloir/GraphBuilder / onReleaseEffect

Method onReleaseEffect

graph_view.cpp:419–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417}
418
419void MyGraphicsVexItem::onReleaseEffect(){
420 stopAnimation();
421 QTimeLine *timeLine = new QTimeLine(300, this);
422 timeLine->setFrameRange(0, 100);
423 QEasingCurve curve = QEasingCurve::OutBounce;
424 qreal baseRadius = this->rect().width() / 2;
425 qreal difRadius = (state & ON_HOVER) == 0 ? radius - baseRadius : radius * 1.25 - baseRadius;
426 connect(timeLine, &QTimeLine::frameChanged, [=](int frame){
427 qreal curProgress = curve.valueForProgress(frame / 100.0);
428 qreal curRadius = baseRadius + difRadius * curProgress;
429 this->setRect(QRectF(center.x() - curRadius, center.y() - curRadius, curRadius * 2, curRadius * 2));
430 });
431 curAnimation = timeLine;
432 startAnimation();
433}
434
435void MyGraphicsVexItem::startAnimation(){
436 if(curAnimation != nullptr){

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected