Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Flickable contentY alias in views



  • I need to expose vertical scrolling position to the C++ side of my application. If I make a property alias like this

    TreeView {
      property alias verticalScrollPosition: flickableItem.contentY
      onDoubleClicked: console.log(flickableItem.contentY)
    }
    

    I get the following error: Invalid alias reference. Unable to find id "flickableItem". But if I comment out property declaration and double click any item I get current vertical scrolling printed to a console. What is the reason of this behavior?