Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Handle ActionTriggered event in another QML file?
Forum Updated to NodeBB v4.3 + New Features

Handle ActionTriggered event in another QML file?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 309 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pokemonsrqt
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      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.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved