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. Qt 5.10 Click Problem with Tableview And Flickable
Forum Updated to NodeBB v4.3 + New Features

Qt 5.10 Click Problem with Tableview And Flickable

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

    Hello,

    My environment is Window 10 & Qt 5.10

    I want my Tableview can be flickabled by touch and mouse drag.
    However, in Qt 5.10, Tableview inherits Listview not Flickable.
    Therefore, Flickable component is designed in Tableview for draging.

    But the upcoming problem is that original "click" signal of Tableview is blocked by front Flickable. And I want to get the column wherever is clicked.

    Can anyone help for me?

    Thanks.

    Following is my code

    TableView {
        id: table
        Flickable {
            id: flick
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.bottom: parent.bottom
            anchors.top: parent.top
            anchors.topMargin: headerHeight
            contentWidth: table.flickableItem.contentWidth
            contentHeight: table.flickableItem.contentHeight
            flickableDirection: Flickable.AutoFlickIfNeeded
            boundsBehavior: Flickable.StopAtBounds
            clip: true
            MouseArea {
                anchors.fill: parent
                focus: true
                propagateComposedEvents: true
                onClicked: {
                    // 
                }
            }
        }
        Binding {
            target: table.flickableItem
            property: "contentX"
            value: flick.contentX
        }
        Binding {
            target: table.flickableItem
            property: "contentY"
            value: flick.contentY
        }
    }
    
    
    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