[Interest] need outrow animation for individual list element, without using timer

SUNIL KUMAR M R411063 at HMIE.CO.IN
Thu Oct 18 13:32:35 CEST 2012


Hi,

 

In the below code I am performing animation on list during entry and
exit. 

 

Entry is working fine but I'm not getting desired animation on list
exit. 

 

Here I'm using timer  for exit animation on list. 

 

Is there any other way of performing exit animation on list, without
using timer.

 

 

 

 

Item {

    id: root

    width:640

    height:480

    focus: true

    ListModel {

             id: fruitModel

 

             ListElement {

                 name: "Apple"; posx: 300; h: 20; i: 0;

             }

             ListElement {

                 name: "Banana"; posx: 250; h: 25; i: 1;

             }

             ListElement {

                 name: "Cumquat"; posx: 200; h: 30; i: 2;

             }

             ListElement {

                 name: "Durian"; posx: 150; h: 35; i: 3;

             }

         }

 

    Component {

        id:listDelegate

 

        Item {

            id: delegateItem

            width:parent.width

            x: posx

            visible : false

            height: 0

            property int pause: i * 1000

 

            Text {

                id: listitem

                text: name

                //font.pointsize: 12

            }

 

            Component.onCompleted : SequentialAnimation {

                PauseAnimation {duration : pause }

                PropertyAction { target: delegateItem; property:
"visible" ; value : true }

                NumberAnimation { target : delegateItem ; property:
"height" ; to : h; duration : 1000 * 2  ;easing.type: Easing.InOutQuad }

            }

        }

    }

 

SequentialAnimation {id:outRow; running:false

 

ParallelAnimation{

PropertyAnimation{ targer: view .currentitem}

}

                PauseAnimation {duration : pause }

                PropertyAction { target: view.currentItem; property:
"visible" ; value : true }

                NumberAnimation { target : view.currentItem; property:
"height" ; to : h; duration : 100 * 2  ;easing.type: Easing.InOutQuad }

            }

 

Timer{

Id:ouRowTimer

Interval:300

Running:false

Repeat:true

onTriggered:{

outRow.running=true;

view.currentIndex++;

}

 

}

 

    ListView {

        id: view

        anchors.fill : parent

        model:fruitModel

        delegate : listDelegate

 

        highlight {

            Item {

                Image {

                    y:0 ; height:40 ; source : "menu_focus.png"

                }

            }

        }

    }

 

}

 

 

Thanks 

 

Sunil

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20121018/11135f76/attachment.html>


More information about the Interest mailing list