Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Regular Contributor
Posts: 56
Registered: ‎06-25-2012
My Device: non-blackberry user
My Carrier: Airtel

Connections QML element in Cascades

Hello Friends,

 

I have a new problem now !!

 

I am invoking a c++ method from my QML code , that code on completion emits signal with some data.

 

Like

 

Q_INVOKABLE void calledFromQML()

{

// function body

emit functionCompleted(status)

}

 

Now on QML side i need this status data i am using Connections QML element for that

 

import QtQuick 1.0

 

Page {

 

attachedObjects[

Connections{

target:myCppClass

onFunctionCompleted: {

console.log(status)

}

}

]

}

 

 

Problem is i am always getting compilation error, invalid signal any thoughts on thi !!

Developer
Posts: 543
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: Connections QML element in Cascades

[ Edited ]

You can connect to the C++ signal like this:

 

Page{

    function myFunction(status){
        // your logic
        console.debug(status)
    }

    onCreationCompleted: {
        myCppClass.functionCompleted.connect(myFunction)
    }

}

 Hope it helps



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog