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
Developer
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer
My Carrier: relience

Q_INVOKABLE paramater error

Hello,

 

I am learing cascades.

I am trying to integrate c++ with QML.

Currently I am having one problem in Q_INVOKABLE method,

 

Can I pass my custom object as a paramater in the Q_INVOKABLE method?

I am able to pass the simple data types but not the custom class as the parameter.

 

thanks in advance.

bskania.

Developer
Posts: 52
Registered: ‎03-29-2012
My Device: Playbook, Dev Alpha
My Carrier: Telus

Re: Q_INVOKABLE paramater error

I think if your custom class extends QObject, you could do this.
Developer
Posts: 849
Registered: ‎03-03-2011
My Device: Z10

Re: Q_INVOKABLE paramater error

And you need to register.
--------------------------------------------------------------------------------------
Leader of Ljubljana BlackBerry Developer Group
BlackBerry Certified Builder for Native Application Development
Developer
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer
My Carrier: relience

Re: Q_INVOKABLE paramater error

I had registered the object also and the class is extended from QObject. Still I am not able to use,

Developer
Posts: 849
Registered: ‎03-03-2011
My Device: Z10

Re: Q_INVOKABLE paramater error

Check https://developer.blackberry.com/cascades/documentation/ui/integrating_cpp_qml/index.html under Using the attachedObjects property.

After registration add new object under attachedProperties. Then call it by using its id.method_name.

Using timer is a good example.
--------------------------------------------------------------------------------------
Leader of Ljubljana BlackBerry Developer Group
BlackBerry Certified Builder for Native Application Development