Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

ListView remove : Transition Not playing



  • Hello,
    i have a ListView where i can delete items: i added a transition on 'remove'

     ListView{
                    id: errArea
                    clip:true
                    header: Rectangle{
                        height: 30
                        width: parent.width
                        color: "gray"
    
                        Text{
                            anchors.verticalCenter: parent.verticalCenter
                             text: qsTr("Messages ") + "(" + errArea.model.count + ")"
                        }
                    }
                    height: errZon.height
                    width:errZon.width
                    remove: Transition {
                        NumberAnimation { property: "x"; to: width; duration:300}
                        ColorAnimation {
                            property: "color"
                            to: "green"
                            duration: 350
                        }
                    }
    
    
                    delegate:GUI.ErrDelegate{ // this is just a rectangle + text with little imageButton for delete
                        height:20
                        _txt: index + " : " + err
                        onRem: errModel.remove(index)
                    }
    
                    model:errModel
    
                }
    

    My probleme is : the transition is played only if 2 conditions are verified : only if i delete the last item && if that item is visible without moving (scrolling) the listView... ( if item.height * model.count > listView.height no transition is played even with deleting the last )

    Can someone telle me what can cause this behavior ?
    Thanks.


Log in to reply