ScrollView scrolling through signals



  • Hi there,
    I wanted to know if it is possible to navigate through signals in a ScrollView. My app runs in a device with touch screen and some external buttons. With these buttons I can select some items on the screen (I can code which items to select). This method is used in case the touch screen fails. What I want to do is to scroll down or up in a ScrollView through the buttons (signals) or if it possible to auto scroll to the item selected that its not on screen, outside the view area.
    Thanks in advance
    Best regards


  • Moderators

    @geageagea ScrollView provides flickableItem property which gives access to the flickable item it holds. You can use its contentX and contentY properties to change the position.
    Something like:

    Button {
        text: "Down"
        onClicked: {
            scrollView.flickableItem.contentY += 10 // 10 = How much you want to scroll?
        }
    }
    Button {
        text: "Right"
        onClicked: {
            scrollView.flickableItem.contentX += 10
        }
    }
    

    For the opposite effect just negate the values.



  • Hi @p3c0
    It seems that I missed that part of the documentation.
    Thanks a lot, that solved my issue
    Best regards


Log in to reply
 

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