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. Flickable with Scrollbar Touch Issues
Forum Updated to NodeBB v4.3 + New Features

Flickable with Scrollbar Touch Issues

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 1 Posters 675 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.
  • R Offline
    R Offline
    rhb327
    wrote on last edited by
    #1

    I have a Flickable (actually it's a TableView) in QML. Flick gestures and mouse gestures seem to work fine. However, the scrollbar does not seem to respond to touch drag or press events. These same gestures with the mouse seem to work fine with a left click on the background of the scrollbar or a left click and drag on the handle of the scroll bar. My preference is to be able to flick or drag the scrollbar handle at will (no mouse).

     TableView {
            id: eventLogView
            anchors{left: parent.left; leftMargin: 30;
                top: filterInputFields.bottom; topMargin: 10
                right: parent.right; rightMargin: 60;
                bottom: footerSeparator.top
            }
            flickableItem.boundsBehavior: Flickable.StopAtBounds
            flickableItem.synchronousDrag: false
            frameVisible: false
            headerVisible: true
            alternatingRowColors: false
            horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff
            verticalScrollBarPolicy: Qt.ScrollBarAlwaysOn
            sortIndicatorColumn: 0
            sortIndicatorOrder: Qt.DescendingOrder
            model: sqlELmodel
    
            ScrollBar.vertical: ScrollBar {
                // Orientation, Position, Size & Active auto-set
                z: 100
                enabled: true
                interactive: true
                minimumSize: 0.10
                width: 10
                snapMode: ScrollBar.SnapAlways
            }
    
            style: TableViewStyle {
                id: tvStyle
    
                decrementControl: Rectangle {
                    width: 0
                    visible: false
                }
                incrementControl: Rectangle {
                    width: 0
                    visible: false
                }
                scrollToClickedPosition: true
                handle: Rectangle {
                    visible: (recNum > 4)
                    implicitWidth: 10
                    radius: width/2
                    color: "#2EA2EC"
                }
                scrollBarBackground: Rectangle {
                    visible: (recNum > 4)
                    width: 10
                    radius: width/2
                    color: "#DBDDDD"
                }
    
                headerDelegate: Rectangle {
    

    Thanks,
    -Rich

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rhb327
      wrote on last edited by
      #2

      Here's a one file simple example that shows the problem. I can drag the vertical scrollbar handle with the mouse but not with a touch. I can click in the scrollbar background with the mouse but not with a touch. How does one fix this? It's almost like the ScrollBar is a ScrollIndicator.

      import QtQuick.Window 2.12
      import QtQuick 2.12
      import QtQuick.Controls 1.4
      import QtQuick.Controls 2.5
      import QtQuick.Controls.Styles 1.4
      
      Window {
          width: 641
          height: 480
          visible: true
          title: qsTr("Hello World")
          Rectangle {
              width: 640
              height: 200
              anchors.fill: parent
              TableView {
                  id: tv
                  horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff
                  verticalScrollBarPolicy: Qt.ScrollBarAlwaysOn
                  TableViewColumn {
                      role: "title"
                      title: "Title"
                      width: 100
                  }
                  TableViewColumn {
                      role: "author"
                      title: "Author"
                      width: 200
                  }
                  model: libraryModel1
                  style:  TableViewStyle {
                      decrementControl: Rectangle {
                          width: 0
                          visible: false
                      }
                      incrementControl: Rectangle {
                          width: 0
                          visible: false
                      }
                      scrollToClickedPosition: true
                      handle: Rectangle {
                          visible: true
                          implicitWidth: 10
                          radius: width/2
                          color: "#2EA2EC"
                      }
                      scrollBarBackground: Rectangle {
                          visible: true
                          width: 10
                          radius: width/2
                          color: "#DBDDDD"
                      }
                  }
      
                  ListModel {
                      id: libraryModel1
                      ListElement {
                          title: "A Masterpiece"
                          author: "Gabriel"
                      }
                      ListElement {
                          title: "Brilliance"
                          author: "Jens"
                      }
                      ListElement {
                          title: "Outstanding"
                          author: "Frederik"
                      }
                      ListElement {
                          title: "A Masterpiece"
                          author: "Gabriel"
                      }
                      ListElement {
                          title: "Brilliance"
                          author: "Jens"
                      }
                      ListElement {
                          title: "Outstanding"
                          author: "Frederik"
                      }
                      ListElement {
                          title: "A Masterpiece"
                          author: "Gabriel"
                      }
                      ListElement {
                          title: "Brilliance"
                          author: "Jens"
                      }
                      ListElement {
                          title: "Outstanding"
                          author: "Frederik"
                      }
                  }
              }
          }
      }
      
      
      1 Reply Last reply
      0
      • R Offline
        R Offline
        rhb327
        wrote on last edited by
        #3

        Submitted to Qt support...response was:

        Thank you for contacting Qt Support,

        If your embedded device uses touch screen, the input for scrollbar is disabled when a touch input is used as it's not really practical and and flicking the view is usually preferred with touch input.

        However, if you attach a mouse to your device the input works for scrollbar is it mainly ignoring the input that is not coming from a genuine mouse, but accepts it when a real mouse is used.

        Does this make sense to you?

        ---------------8<--------------------------------------------
        I read this as for touch a scrollbar is basically a scroll indicator.

        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