coolmac
16th July 2008, 05:27
Hi all,
I have just started programming using Qt4.4.
I was trying the example given in
http://labs.trolltech.com/blogs/2007/07/17/connecting-to-qtscript-functions-from-c/
The only thing I have changed here is that I have defined a class MyWindow which incorporates the window,awakenButton and exitButton.
I was successful in connecting javascriptfile using a signal(buttonClicked()) defined in MyWindow class to a javascript file using
qScriptConnect(obj1, SIGNAL(buttonClicked()), object, slot);
obj1-object of MyWindow.
I want to connect to a signal defined in MyWindow class from javascript file and emit this signal in the same scriptfile so I tried using the syntax given in QtScript Module (Qt4.4)but it didnt work. Is there any specific way to connect to a signal from scriptfile?
Also,once the connection is established, can we initialize objects in scriptfile like
var obj2=new MyWindow;
I tried this but this also wasnt working.
Is this possible and is this the right way?
Thnx in advance.
I have just started programming using Qt4.4.
I was trying the example given in
http://labs.trolltech.com/blogs/2007/07/17/connecting-to-qtscript-functions-from-c/
The only thing I have changed here is that I have defined a class MyWindow which incorporates the window,awakenButton and exitButton.
I was successful in connecting javascriptfile using a signal(buttonClicked()) defined in MyWindow class to a javascript file using
qScriptConnect(obj1, SIGNAL(buttonClicked()), object, slot);
obj1-object of MyWindow.
I want to connect to a signal defined in MyWindow class from javascript file and emit this signal in the same scriptfile so I tried using the syntax given in QtScript Module (Qt4.4)but it didnt work. Is there any specific way to connect to a signal from scriptfile?
Also,once the connection is established, can we initialize objects in scriptfile like
var obj2=new MyWindow;
I tried this but this also wasnt working.
Is this possible and is this the right way?
Thnx in advance.