CodePudding user response:
It should be 3 d implementation! What's the coverflow effect!CodePudding user response:
This is really a qt animation function, use the class: QParallelAnimationGroup, QSequentialAnimationGroup, QPropertyAnimation, the use of these classes can see qt assistant,Pictures of each item is a label shown in the pictures, when the left click button, click the right button, for example, all the label right mobile distance, comprise the mobile preview function,
My side have relevant example code, can consult:
Void Guide: : SetCapRetAnimation ()
{
Group=new QSequentialAnimationGroup QSequentialAnimationGroup * (this);
Int msec=2000;
Int hx=160, hw=225, hh=221;
QPropertyAnimation * lhAnima=new QPropertyAnimation (UI - & gt; Img_label, "geometry");
SetAnimationValue (lhAnima, QRect (hx, 595, hw, hh), QRect (hx, UI - & gt; Img_label - & gt; Y (), hw, hh), msec);
Int x=695;
QPropertyAnimation * rhAnima=new QPropertyAnimation (UI - & gt; Star_img_label, "geometry");
SetAnimationValue (rhAnima, QRect (sx, 595, hw, hh), QRect (sx, UI - & gt; Star_img_label - & gt; Y (), hw, hh), msec);
Int LNX=UI - & gt; Img_name_label - & gt; (x), nw=UI - & gt; Img_name_label - & gt; Width (), nh=UI - & gt; Img_name_label - & gt; Height ();
QPropertyAnimation * lnAnima=new QPropertyAnimation (UI - & gt; Img_name_label, "geometry");
SetAnimationValue (lnAnima, QRect (LNX, 596, nw, nh), QRect (LNX, UI - & gt; Img_name_label - & gt; Y (), nw, nh), msec);
Int RNX=UI - & gt; Star_name_label - & gt; (x);
QPropertyAnimation * rnAnima=new QPropertyAnimation (UI - & gt; Star_name_label, "geometry");
SetAnimationValue (rnAnima, QRect (RNX, 596, nw, nh), QRect (RNX, UI - & gt; Star_name_label - & gt; Y (), nw, nh), msec);
Int vx=411, vy=250, vw=258, vh=73;
QPropertyAnimation * vaAnima=new QPropertyAnimation (UI - & gt; Vs_label, "geometry");
SetAnimationValue (vaAnima, QRect (vx, 596, vw, vh), QRect (vx, vy, vw, vh), msec).
//connect (vaAnima, SIGNAL (valueChanged (const QVariant&) ), this SLOT (AnimaValueChange (const QVariant&) ));
Int tx=0, ty=0, tw=1080, th=126;
QPropertyAnimation * tlAnima=new QPropertyAnimation (UI - & gt; TitleW, "geometry");
SetAnimationValue (tlAnima, QRect (tx, 596, tw, th), QRect (UI - & gt; TitleW - & gt; (x), ty, tw, th), msec);
The QParallelAnimationGroup * parGroup=new QParallelAnimationGroup ();
ParGroup - & gt; AddAnimation (lhAnima);
ParGroup - & gt; AddAnimation (rhAnima);
ParGroup - & gt; AddAnimation (lnAnima);
ParGroup - & gt; AddAnimation (rnAnima);
ParGroup - & gt; AddAnimation (vaAnima);
ParGroup - & gt; AddAnimation (tlAnima);
Group - & gt; AddAnimation (parGroup);
Group - & gt; Start (QAbstractAnimation: : DeleteWhenStopped);
}
Void Guide: : SetAnimationValue (QPropertyAnimation * animation, const QVariant & amp; Startval,
Const QVariant & amp; Endval, int msec)
{
Animation - & gt; SetDuration (msec);
Animation - & gt; SetStartValue (startval);
Animation - & gt; SetEndValue (endval);
Animation - & gt; SetEasingCurve (QEasingCurve: : InOutBounce);
}
Actually good simple, calling the qt animation related classes interface, complex work, every step is to calculate the animation where sliding is to sports where, for example, set the initial position and end position,
CodePudding user response:
Thank you for your reply, what do you want to be the effect on the QT, is about the slide switch images, and then click on the image to produce the corresponding eventThis can be achieved, please?
In addition to the QML: are there any other method
CodePudding user response: