Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. SwipeView problems
Forum Updated to NodeBB v4.3 + New Features

SwipeView problems

Scheduled Pinned Locked Moved Solved QML and Qt Quick
1 Posts 1 Posters 567 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • beeckscheB Offline
    beeckscheB Offline
    beecksche
    wrote on last edited by beecksche
    #1

    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"
                            }
                        }
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved