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

Switchview and Switch



  • I made a switchview with multiple pages but when I press on the button it starts moving to the most left view.
    It will not stop moving to the page on the left every 2 second.

    import QtQuick 2.0
    import CustomComponents 1.0
    import QtQuick.Controls 2.0
    Rectangle {
        id: mainview
        x:0;y:0;width:480;height:272;
        color: "#ffffff"
        visible: true
    
        SwipeView {
            id: view
            currentIndex: 1
            anchors.fill: parent
            
            Page1{
                x:0
                y:0
                width:480
                height:272
            }
            Page2{
                x:0
                y:0
                width:480
                height:272
            }
            Item {
                width:480
                height:272
    
                Switch {
                    id: swGreenLED
                    x: 50
                    y: 80
                    z: 50
                    text: qsTr("Green")
                    checked: false
                }
            }
        }
    }
    


  • @remco1271 - possibly because you have 'currentIndex: 1', try setting to '-1' instead.


Log in to reply