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

Can we add mouse area to a component.



  • @Component{

    Item {}

    MouseArea {}

    }@

    Is this possible??



  • "Components are reusable, encapsulated QML elements with well-defined interfaces"
    it means that it's an element as well

    you can use @Component{
    MouseArea{
    /*usually : */ anchors.fill : parent
    onClicked : console.log('clic')
    }
    }@


Log in to reply