QML-SwipeView

    SwipeView {
        id: swipeView
        z:0;
        width: parent.width-listView.width;
        height: parent.height;
        anchors.left: listView.right;
        interactive: false;//禁止手拖动
        currentIndex: listView.currentIndex;
        Component.onCompleted:{
            contentItem.highlightMoveDuration = 0;       //将移动时间设为0
        }
        //树1
        Tree_1 {

        }

        //树2
        Tree_2 {

        }
    }

注意:SwipeView的index变化时候,如从1切换到2,1并不会消失,而是从当前屏幕左移或者右移动,并且可能会覆盖到其他控件上,可以通过设置clip: true;

原文地址:https://www.cnblogs.com/judes/p/13451803.html