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
Forum Updated to NodeBB v4.3 + New Features

connect and disconnect signals in js

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 513 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.
  • A Offline
    A Offline
    ashajg
    wrote on 13 Feb 2019, 11:58 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

    1/1

    13 Feb 2019, 11:58

    • Login

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