Qt World Summit: Register Today!


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