StackView & Transitions



  • @
    import QtQuick 2.2
    import QtQuick.Window 2.1
    import QtQuick.Controls 1.1

    Window {
    id: window

    visible: true
    width: 360
    height: 260
    
    
    ListView {
        id: view
        model: 1000
        populate: Transition {
            SpringAnimation { spring: 3; damping: 0.2 }
        }
        delegate: Text {
            text: modelData
        }
    }
    
    StackView {
        id: stackView
        anchors.fill: parent
        initialItem: view
    }
    

    }
    @

    without Transition ListView is filled properly, and with it - the first of items huddling together

    [edit: Added missing coding tags @ SGaist]


  • Moderators

    Hi,

    Use Item instead of Window as root object. And provide a width and height to ListView or use anchors.fill: parent.
    To load Item based component you will need QQuickView.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.