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. Problem with Listview in Listview
Forum Updated to NodeBB v4.3 + New Features

Problem with Listview in Listview

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 488 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.
  • W Offline
    W Offline
    winkler3523
    wrote on last edited by
    #1

    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

    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