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

Method hoverInEffect

graph_view.cpp:380–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378}
379
380void 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
397void MyGraphicsVexItem::hoverOutEffect(){
398 stopAnimation();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected