Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML to QML signal
Qt 6.12 LTS is out! See what's new in the release blog

QML to QML signal

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 3 Posters 572 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.
  • G Offline
    G Offline
    Gery
    wrote on last edited by
    #1

    I tried reading most the blogs and tried to receive signal from one QML to another QML
    I have three QML files, first.qml second.qml third.qml
    In main.qml I have stack view and pushing these qml on click of buttons,
    I have used
    Component{
    id: first
    First {}
    }
    to load my components.
    Now, I want to emit a signal from second.qml and call the slot of first.qml.
    can anyone help me how can I achieve same.

    johngodJ B 2 Replies Last reply
    0
    • G Gery

      I tried reading most the blogs and tried to receive signal from one QML to another QML
      I have three QML files, first.qml second.qml third.qml
      In main.qml I have stack view and pushing these qml on click of buttons,
      I have used
      Component{
      id: first
      First {}
      }
      to load my components.
      Now, I want to emit a signal from second.qml and call the slot of first.qml.
      can anyone help me how can I achieve same.

      johngodJ Offline
      johngodJ Offline
      johngod
      wrote on last edited by
      #2

      @Gery Hi here is a possible solution

      MainView {
      	
      	First{
      	id: first
      		signal sig1()
      	}
      	
      	Second{
      	id: second
      		signal sig2()
      	}
      
      	Componen.onComplet: {
      		second.sig2.connect( first.sig1 )
      	}
      }
      
      B 1 Reply Last reply
      0
      • johngodJ johngod

        @Gery Hi here is a possible solution

        MainView {
        	
        	First{
        	id: first
        		signal sig1()
        	}
        	
        	Second{
        	id: second
        		signal sig2()
        	}
        
        	Componen.onComplet: {
        		second.sig2.connect( first.sig1 )
        	}
        }
        
        B Offline
        B Offline
        Bracha
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • G Gery

          I tried reading most the blogs and tried to receive signal from one QML to another QML
          I have three QML files, first.qml second.qml third.qml
          In main.qml I have stack view and pushing these qml on click of buttons,
          I have used
          Component{
          id: first
          First {}
          }
          to load my components.
          Now, I want to emit a signal from second.qml and call the slot of first.qml.
          can anyone help me how can I achieve same.

          B Offline
          B Offline
          Bracha
          wrote on last edited by Bracha
          #4

          @Gery
          I did something like this:
          first.qml:

          Grid {
          property alias Btn: myBtn
          Button{
          id: myBtn
          signal callToSecond()
          onClicked: callToSecond()
          }
          }
          

          second.qml:

          Connections {
          target: Btn
          function onCallToSecond(){
          console.log("hi from second")
          }
          }
          
          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
          • Unsolved