[Qt-qml] Call C++ Slot from Workerscript.sendmessage

Schmidt dres-schmidt at t-online.de
Mon Nov 1 12:37:37 CET 2010


> Hi All,
> 
>  
> 
> how do i call a slot of my c++-Programm from
> 
> the WorkerScript .js file ?
> 
>  
> 
> class MyClass {
> 
> Q_OBJECT
> 
> public slots:
> 
> void work() { /* do something*/ }
> 
> }
> 
>  
> 
> MyClass is given to qml via setContextProperty("myclass", MyClass);
> 
>  
> 
> dataload.js:
> 
>  
> 
> WorkerScript.onMessage = function(msg) {
> 
>     if (msg.action == 'load') {
> 
>         myclass.work();   // DOES NOT WORK      function just returns here, no error
> 
>     }
> 
> }
> 
>  
> 
> Regards,
> 
>  
> 
>  
> 
> Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20101101/a77ca952/attachment.html 


More information about the Qt-qml mailing list