Use a PinchArea on ListView



  • Hello,

    I want to use PinchArea on ListView. Unfortunately, I think that the flickable function(office) of ListView is in conflict with PinchArea and I have to use 3 fingers so that PinchArea works correctly.

    This is an example of my code :

    import QtQuick 2.5
    import QtQuick.Controls 1.4
    import QtQuick.XmlListModel 2.0
    
    ApplicationWindow {
        id: app
        visible: true
        width: 640
        height: 480
    
        Component {
            id: rssDelegate
            Column {
                Label {
                    text: '<h2><b>'+ title+ '</b></h2>'
                    color: "steelblue"
                    wrapMode: Text.WordWrap
                    width: listview.width
                }
                Label {
                    text: description + '<br>'
                    wrapMode: Text.WordWrap
                    width: listview.width
                }
                Label {
                    text: "<i>PubliƩ le : " + pubDate + "</i><br><br>"
                    wrapMode: Text.WordWrap
                    width: listview.width
                }
            }
        }
        
        PinchArea{
            anchors.fill: parent
            pinch.target: listview
            pinch.minimumScale: 0.1
            pinch.maximumScale: 5
            pinch.dragAxis: Pinch.XAndYAxis
        }
        
        ListView {
            id: listview
            anchors.fill: parent
            anchors.margins: 5
            model: xmlModel
            delegate: rssDelegate
        }
        
        XmlListModel{
            id: xmlModel
            source: "http://qt.developpez.com/index/rss"
            query: "/rss/channel/item"    
            XmlRole { name: "title"; query: "title/string()" }
            XmlRole { name: "pubDate"; query: "pubDate/string()" }
            XmlRole { name: "description"; query: "description/string()" }      
        }   
    }
    

    I tried to use the property pressDelay ListView and also a MultiTouchArea to see if one or two fingers were used, but I still have the same problem.

    Have you an idea.

    Thank you in advance.

    Charlie



  • Hi,
    Did you solve this issue ?
    I am interessted, because I am facing the same problem.
    Thank you so much !

    Cheers,
    Richard


Log in to reply
 

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