oh, didn’t even think about this method before, thanks Godbout :)
> 在 2014年11月28日,下午9:44,Jérôme Godbout <jer...@bodycad.com> 写道:
> 
> You can connect it directly to an handler or another signal:
> 
> Component
> {
>    id: myComponent
>    Item
>    {
>       signal toto()
>    }
> }
> 
> function myCreateFct()
> {
>   // create the object
>   var myNewObj = myComponent.createObject(wantedParent, {});
>   myNewObj.toto.connect(myHandlerDynamicObj);
> }
> 
> function myHandlerDynamicObj()
> {
>   // handle signal here...
> }
> 
> If you want to have the object into parameters you can use a lambda into the 
> handler
> 
> myNewObj.toto.connect(myHandlerDynamicObj); --> 
> myNewObj.toto.connect(function() { myHandlerDynamicObj(myNewObj); });
> 
> function myHandlerDynamicObj(myObj) {}
> 
> You can also use the disconnect the same way
> 
> On Fri, Nov 28, 2014 at 12:22 AM, hualet <mr.asianw...@gmail.com 
> <mailto:mr.asianw...@gmail.com>> wrote:
> Hi, dear list, like what I said in the title, is there a way to connect the 
> signal of an object that was created dynamically? thanks ;)
> _______________________________________________
> Interest mailing list
> Interest@qt-project.org <mailto:Interest@qt-project.org>
> http://lists.qt-project.org/mailman/listinfo/interest 
> <http://lists.qt-project.org/mailman/listinfo/interest>
> 

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to