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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Developer
bskania
Posts: 105
Registered: ‎04-24-2012
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.

Please use plain text.
Developer
level32
Posts: 52
Registered: ‎03-29-2012
My Carrier: Telus

Re: Q_INVOKABLE paramater error

I think if your custom class extends QObject, you could do this.
Please use plain text.
Developer
soaman
Posts: 610
Registered: ‎03-03-2011
My Carrier: Mobitel

Re: Q_INVOKABLE paramater error

And you need to register.
--------------------------------------------------------

Follow our developer blog on Slovenia BlackBerry Developer Group!
Please use plain text.
Developer
bskania
Posts: 105
Registered: ‎04-24-2012
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,

Please use plain text.
Developer
soaman
Posts: 610
Registered: ‎03-03-2011
My Carrier: Mobitel

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.
--------------------------------------------------------

Follow our developer blog on Slovenia BlackBerry Developer Group!
Please use plain text.