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

SwipeView problems



  • Hi,
    I have a strange behavior with a SwipeView in a SwipeView. The problem only occurs on a touchscreen, so i can't reproduce it on my PC.

    import QtQuick 2.11
    import QtQuick.Controls 2.4
    import QtQuick.Layouts 1.11
    import QtCharts 2.2
    import QtQuick.Window 2.3
    
    ApplicationWindow {
        visible: true
        visibility: Window.FullScreen
    
        Drawer {
            width: 0.15 * parent.width
            height: parent.height
    
            ColumnLayout  {
                anchors.fill: parent
                Button {
                    text: "Swipe1 Page1"
                    Layout.fillWidth: true
    
                    onClicked: swipe1.setCurrentIndex(0)
                }
                Button {
                    text: "Swipe1 Page2"
                    Layout.fillWidth: true
    
                    onClicked: swipe1.setCurrentIndex(1)
                }
    
                Button {
                    text: "Exit"
                    Layout.fillWidth: true
    
                    onClicked: close()
                }
            }
        }
    
        SwipeView {
            id: swipe1
            anchors.fill: parent
    
            Item {
                Label {
                    anchors.centerIn: parent
                    text: "Swipe1 Page1"
                }
            }
    
            Item {
                GridLayout {
                    anchors.fill: parent
                    columns: 2
    
                    Button {
                        text: "Swipe2 Page1"
                        onClicked: swipe2.setCurrentIndex(0)
                    }
    
                    Button {
                        text: "Swipe2 Page2"
                        onClicked: swipe2.setCurrentIndex(1)
                    }
    
                    SwipeView {
                        id: swipe2
    
                        clip: true
                        interactive: false
    
                        Layout.columnSpan: 2
                        Layout.fillWidth: true
                        Layout.fillHeight: true
    
                        Item {
                            Label {
                                anchors.centerIn: parent
                                text: "Swipe2 Page1"
                            }
                        }
    
                        ChartView {
    
                        }
                    }
                }
            }
        }
    }
    
    

    On my PC all works fine, no problems.

    But on the Touchscreen:
    When the Swipe2 Page1 is on the screen, i'm not able to change the currentIndex of swipe1, although it works when the ChartView (Swipe2 Page2) is on the screen.

    It seems that, if i want to swipe on Swipe2 Page1, the background (in my case the terminal) will be selected.

    Any help to find out why this is happen?

    Edit:
    I added a MouseArea to that Item and now i can swipe.

                        Item {
                            MouseArea { anchors.fill: parent; }
    
                            Label {
                                anchors.centerIn: parent
                                text: "Swipe2 Page1"
                            }
                        }
    

Log in to reply