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

Swipeview Within Loader Issue



  • I am trying to use a Swipeview component within a Loader component. I am finding that when used within the Loader, the Swipeview appears but does not allow me to actually swipe between items. See examples below:

    Swipes:

    SwipeView {
        currentIndex: 1
        anchors.fill: parent
        Item {
            Rectangle {
                width: 50
                height: 50
                color: "Blue"
            }
        }
        Item {
            Rectangle {
                width: 50
                height: 50
                color: "Red"
            }
        }
    }
    

    Does not swipe:

        Loader {
            sourceComponent: swipe
        }
    
        Component {
            id: swipe
            SwipeView {
                currentIndex: 1
                anchors.fill: parent
                Item {
                    Rectangle {
                        width: 50
                        height: 50
                        color: "Blue"
                    }
                }
                Item {
                    Rectangle {
                        width: 50
                        height: 50
                        color: "Red"
                    }
                }
            }
        }
    

Log in to reply