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

Method slideOut

slidepage.cpp:134–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134void SlidePage::slideOut(){
135 if(curAni){
136 curAni->stop();
137 curAni->deleteLater();
138 curAni = nullptr;
139 }
140 onShown = false;
141 sheildLayer->setEnabled(false);
142 QParallelAnimationGroup *outGroup = new QParallelAnimationGroup(this);
143 QPropertyAnimation *slideOutAni = new QPropertyAnimation(this, "pos", this);
144 slideOutAni->setStartValue(this->pos());
145 slideOutAni->setEndValue(QPoint(-this->width() - 30, 0));
146 slideOutAni->setDuration(1000);
147 slideOutAni->setEasingCurve(QEasingCurve::InOutExpo);
148 QPropertyAnimation *fadeOutAni = new QPropertyAnimation(opacity, "opacity", this);
149 fadeOutAni->setStartValue(opacity->opacity());
150 fadeOutAni->setEndValue(0);
151 fadeOutAni->setDuration(750);
152 QPropertyAnimation *rotateAni = new QPropertyAnimation(backIcon, "rotationAngle", this);
153 rotateAni->setStartValue(360);
154 rotateAni->setEndValue(180);
155 rotateAni->setDuration(750);
156 rotateAni->setEasingCurve(QEasingCurve::InOutExpo);
157 outGroup->addAnimation(slideOutAni);
158 outGroup->addAnimation(fadeOutAni);
159 outGroup->addAnimation(rotateAni);
160 connect(outGroup, &QPropertyAnimation::finished, this, [=](){this->curAni = nullptr;pageContentContainer->scrollToTop();sheildLayer->hide();});
161 connect(this, &SlidePage::sizeChange, slideOutAni, [=](){slideOutAni->setEndValue(QPoint(-this->width() - 30, 0));});
162 outGroup->start();
163 curAni = outGroup;
164}

Callers 1

InitMethod · 0.80

Calls 3

addAnimationMethod · 0.80
scrollToTopMethod · 0.80
setEnabledMethod · 0.45

Tested by

no test coverage detected