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. passing signal handler defined in one qml file to another top level qml file.
Forum Updated to NodeBB v4.3 + New Features

passing signal handler defined in one qml file to another top level qml file.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 606 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.
  • J Offline
    J Offline
    JennyAug13
    wrote on last edited by JennyAug13
    #1

    How can i pass a signal handler of the signal defined in one qml file to another top level qml file. @dheerendra

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

      This question has been asked many times in the forum. Can you look at them ? Signal is sent from one object to another object. You need to have instances of each of the object from QML components. Once you have objects either you can use Connections{} or connect way to pass the data from one object to another object.

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

      1 Reply Last reply
      1
      • J Offline
        J Offline
        JennyAug13
        wrote on last edited by JennyAug13
        #3

        @dheerendra
        I can find this post to solve the issue,

        https://stackoverflow.com/questions/40407583/how-to-send-a-signal-from-one-qml-to-another

        but in my case, i have button.qml, control.qml and multiControl.qml.

        My signal

        signal buttonsOverlapped() 
        

        is defined in button.qml and inside my multiControl.qml i have control element and inside my control.qml i have button element.

        I want to use the signal handler

        onbuttonsOverlapped:{
        
        }
        

        inside my multiControl.qml file, i tried it placing under control element of this file and also outside of the control element as follows

        Button.onButtonsOverlapped: {
                        console.log("hello")
                    }
        

        It is causing to stop the next view to be loaded.

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

          Can place simple sample application. We will quickly help you.

          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