Handle ActionTriggered event in another QML file?

  • I have this action:

    Action {
        id: zoomInX
        text: qsTr("Zoom In X-Axis")
        shortcut: StandardKey.ZoomIn

    I want to handle the onTriggered event for that action in some other QML file like:

    onTriggered.zoomInX {
        // do stuff

    How can I go about doing this?

  • Qt Champions 2017

    You need to work with singnals/slots between different objects. Just define the signal and send it in onTriggered handler. Pass the appropriate parameters in signal. Handle the signal in another qml file side.

Log in to reply