<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[connect and disconnect signals in js]]></title><description><![CDATA[<p dir="auto">Hi guys</p>
<p dir="auto">I am trying to connect and disconnect signals of qml in .js.</p>
<p dir="auto">In this function I am creating objects of qml and establishing connection by writing this line</p>
<p dir="auto"><strong>mainrow.children[1].tvclicked.connect(onTvclicked);</strong></p>
<pre><code>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})

}
</code></pre>
<p dir="auto">However I want to disconnect connection on certain event so I wrote another function</p>
<pre><code>function changes(mode)
{
console.log("changes---&gt;"+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
    }
}
</code></pre>
<p dir="auto">but I am unable to disconnect ...this is not working  <strong>mainrow.children[1]. <strong>tvclicked.disconnect(onTvclicked)</strong></strong></p>
<p dir="auto">why it is not getting disconnected?</p>
]]></description><link>https://forum.qt.io/topic/99637/connect-and-disconnect-signals-in-js</link><generator>RSS for Node</generator><lastBuildDate>Mon, 16 Mar 2026 11:10:03 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/99637.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 13 Feb 2019 11:58:02 GMT</pubDate><ttl>60</ttl></channel></rss>