'Cannot access public function from different QML file

Qt 6.2.0 Ubuntu 20.04

Content.qml

PathView {
    id: view

    function myFunc(type) {
        console.log(type)
    }
}

Main.qml

ApplicationWindow {
    id: window

    Item {
        id: item

        Content {
          id: content
        }
    }

    Item {
       content.myFunc(1) // <-- Expected token :
    }
}

What is the right syntax to call myFunc()?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source