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. Use a PinchArea on ListView
Forum Update on Monday, May 27th 2025

Use a PinchArea on ListView

Scheduled Pinned Locked Moved QML and Qt Quick
pincharealistview
2 Posts 2 Posters 1.3k Views
  • 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.
  • C Offline
    C Offline
    CharlieG
    wrote on 6 Oct 2015, 07:38 last edited by
    #1

    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

    1 Reply Last reply
    0
    • R Offline
      R Offline
      richardpaulhesse
      wrote on 4 Mar 2016, 14:30 last edited by
      #2

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

      Cheers,
      Richard

      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