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. connect and disconnect signals in js

connect and disconnect signals in js

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 573 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.
  • ashajgA Offline
    ashajgA Offline
    ashajg
    wrote on last edited by
    #1

    Hi guys

    I am trying to connect and disconnect signals of qml in .js.

    In this function I am creating objects of qml and establishing connection by writing this line

    mainrow.children[1].tvclicked.connect(onTvclicked);

    function finishComponentCreation()
    {var groupLength=4;
    
        console.log("inside finishcomp")
        compcreate=comp.createObject(parentID,{"iCompID":0})
    
    
        tvfourCreation=buttons.createObject(mainrow,{"iCompID":1,"strText":"TV","value":100})
            mainrow.children[1].tvclicked.connect(onTvclicked); ///**connect**
    
        fourCreation=buttons.createObject(mainrow,{"iCompID":2,"strText":"RR","value":100})
        fourCreation=buttons.createObject(mainrow,{"iCompID":3,"strText":"I:E","value":100})
        fourCreation=buttons.createObject(mainrow,{"iCompID":4,"strText":"PEEP","value":100})
    
        moreSetCrt=moreSetting.createObject(mainrow,{"iCompID":5})
    
    }
    

    However I want to disconnect connection on certain event so I wrote another function

    function changes(mode)
    {
    console.log("changes--->"+mode)
        if(mode==="PCV")
        {console.log("########################")
        mainrow.children[1]. tvclicked.disconnect(onTvclicked) // here i am trying to disconnect that connection
         mainrow.children[1]. tvclicked.connect(onRRclicked)// new connection conected to different function
        }
    }
    

    but I am unable to disconnect ...this is not working mainrow.children[1]. tvclicked.disconnect(onTvclicked)

    why it is not getting disconnected?

    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