[Interest] sequential animations on ListView Elements
Ramakanthreddy_Kesireddy
Ramakanthreddy_Kesireddy at mahindrasatyam.com
Thu Oct 11 16:52:38 CEST 2012
As I would like to animate each item separately, I tried the below approach and code:-
Mymodel would include item name, x coordinate and y cordinate ((relative to item’s position in the listview) . It would allow you to animate y from 0 to final value (item animated vertically, from the bottom of the item above). Defined the items to be hidden initially, and show them as part of the sequential animation so that each item is visible and animation is run one after other for each list item.
However, all the items are being shown and then animation is run.
Please correct me if am doing anything wrong in the below code snippet.
Item {
id: root
width:640
height:480
focus: true
ListModel {
id: myModel
ListElement {
name: "Media"; posx: 300; posY: 50;
}
ListElement {
name: "Audio"; posx: 250; posY: 100;
}
ListElement {
name: "Video"; posx: 200; posY: 150;
}
ListElement {
name: "Image"; posx: 150; posY: 200;
}
}
Component {
id:myDelegate
Item {
id: delegateItem
width:parent.width
x: posx
y : posY
visible : false
Text {
id: listitem
text: name
font.pointsize: 12
}
Component.OnCompleted {
addAnimation.start()
}
SequentialAnimation {
id: adAnimation
propertyAction { target:delegateItem; property: "visible" ; value : true }
propertyAction { target:delegateItem; property: "y" ; value : 0 }
NumberAnimation { target : delegateItem ; property: "y" ; to : y; duartion : 1000 ;easing.type: Easing.InOutQuad }
}
}
ListView {
id: view
anchors.fill : parent
model:myModel
delegate : myDelegate
highlight { Item {Image { y:0 ; height:40 ; source : "focus.png" }
}
}
________________________________
From: Jana Aurindam [Aurindam.Jana at digia.com]
Sent: Tuesday, October 09, 2012 9:49 PM
To: Ramakanthreddy_Kesireddy
Cc: interest at qt-project.org
Subject: Re: [Interest] sequential animations on ListView Elements
ViewTransitions are applied when data in the model changes.
If thats not the case, then you need to animate each item separately.
--
Aurindam Jana, Software Engineer - Digia, Qt
Don't Panic!
Digia Germany GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Anja Wasenius
Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
On Oct 6, 2012, at 3:08 PM, Ramakanthreddy_Kesireddy wrote:
Could you please let me know if we can do with View transitions(http://doc-snapshot.qt-project.org/5.0/qml-qtquick2-viewtransition.html) instead.
Best Regards,
Ramakanth
________________________________
From: interest-bounces+ramakanthreddy_kesireddy=mahindrasatyam.com at qt-project.org<mailto:interest-bounces+ramakanthreddy_kesireddy=mahindrasatyam.com at qt-project.org> [interest-bounces+ramakanthreddy_kesireddy=mahindrasatyam.com at qt-project.org<mailto:interest-bounces+ramakanthreddy_kesireddy=mahindrasatyam.com at qt-project.org>] on behalf of Scott Aron Bloom [Scott.Bloom at onshorecs.com<mailto:Scott.Bloom at onshorecs.com>]
Sent: Friday, October 05, 2012 11:01 PM
To: interest at qt-project.org<mailto:interest at qt-project.org>
Subject: Re: [Interest] sequential animations on ListView Elements
There is no built in way with Qt. It can be done, not to difficult, I have done it for clients.
Start with the docs for the IconRole and QTimer
From: interest-bounces+scott.bloom=onshorecs.com at qt-project.org<mailto:interest-bounces+scott.bloom=onshorecs.com at qt-project.org> [mailto:interest-bounces+scott.bloom=onshorecs.com at qt-project.org<mailto:onshorecs.com at qt-project.org>] On Behalf Of SUNIL KUMAR M
Sent: Thursday, September 27, 2012 7:43 PM
To: interest at qt-project.org<mailto:interest at qt-project.org>
Subject: Re: [Interest] sequential animations on ListView Elements
Hai,
I need sample code for doing animations on states and transitions using timer
I created States in my coding, I want to animate those states with respect to timer on properties like opacity, rotation…etc…
Please provide sample code for supporting animations ..
Thanks & regards
Sunil kumar
________________________________
DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
_______________________________________________
Interest mailing list
Interest at qt-project.org<mailto:Interest at qt-project.org>
http://lists.qt-project.org/mailman/listinfo/interest
________________________________
DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20121011/28e9cb9c/attachment.html>
More information about the Interest
mailing list