Problem with Listview in Listview



  • Hello,

    i have a main Page with a Listview, which allows me to switch between pages. Inside of a Page is another, smaller Listview. On the embedded linux system which Touch Input this dosen't work. It seems that the outer Listview steals the touch events. On my desktop machine with mouse input it works correctly.

    Here is a code sample:

    main.qml
    @
    import QtQuick 2.0

    Rectangle {
    width: 800
    height: 400

    ListModel{
        id: qmlModel
        ListElement { sourcePage: "Page1.qml" }
        ListElement { sourcePage: "Page2.qml" }
    }
    
    ListView {
        anchors.fill: parent
        id: listView
    
        snapMode: ListView.SnapOneItem
        highlightRangeMode: ListView.StrictlyEnforceRange
    
        model: qmlModel
    
        delegate: Loader {
            width: ListView.view.width
            height: ListView.view.height
            source: Qt.resolvedUrl(sourcePage)
        }
    }
    

    }
    @

    Page1.qml
    @
    import QtQuick 2.0

    Rectangle {
    anchors.fill: parent
    color: "red"

    ListView {
        anchors.left: parent.left
        anchors.top: parent.top
        width: 400
        height: 150
        spacing: 5
    
        model: Qt.fontFamilies()
        delegate: Item {
            height: 25; width: ListView.view.width
            Text {
                anchors.centerIn: parent
                text: modelData;
                font.family: modelData
                font.pointSize: 20
                fontSizeMode: Text.Fit
                color: "black"
            }
        }
    }
    

    }
    @

    What can i do, that the example works on the touch screen?

    thanks


Log in to reply
 

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