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.

Reply
BlackBerry Development Advisor
rymcdonald
Posts: 150
Registered: ‎01-17-2012
My Device: BlackBerry Z10
My Carrier: Rogers

QML and C++ Communication

This thread is reserved for questions or comments relating to the "QML and C++ Communication" online lesson and lab.

Please use plain text.
Developer
YamilBracho
Posts: 713
Registered: ‎05-31-2010
My Device: 8520
My Carrier: Movistar

Re: QML and C++ Communication

This is not a question. I found a typo in the code:

In the Common Qt classes, in the QDeclarativePropertyMap description, the code goes :

    QmlDocument *qml = QmlDocument::create("main.qml");
    QDeclarativePropertyMap *p = new QDeclarativePropertyMap();

...

It should be
QdeclarativePropertyMap *propertyMap = new QDeclarativePropertyMap();

 

Thanks for this great material!!!!

Please use plain text.
BlackBerry Development Advisor
rymcdonald
Posts: 150
Registered: ‎01-17-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: QML and C++ Communication

Good catch!  We'll apply the fix to this slide and I'll update this thread once it's online.

Please use plain text.
BlackBerry Development Advisor
rymcdonald
Posts: 150
Registered: ‎01-17-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: QML and C++ Communication

We made a few tweaks to this slide and have just republished this course. Thanks again for the feedback! 

Please use plain text.
New Developer
ChetGo
Posts: 15
Registered: ‎05-23-2013
My Device: z10
My Carrier: Singtel

Re: QML and C++ Communication

Slide is still not updated?

 

Still showing YamilBracho's issue above. 

Please use plain text.
New Developer
backslash
Posts: 12
Registered: ‎11-10-2011
My Device: Z10
My Carrier: not important

Re: QML and C++ Communication

The invokable function switchToTopToBottom (Exercise page 6) shouldn't be under public slots: but instead under public: also it's needed to include QPointer (at least for a Momentics Version: 10.2.1 default project template)

Please use plain text.
Contributor
shopen
Posts: 13
Registered: ‎04-02-2013
My Device: Z10
My Carrier: Telus

Re: QML and C++ Communication

You're right. That method doesn't have to be declared as a slot. However, the other method 'swtichBottomToTop' is connected to a signal. They're probably both declared the same way for consistency. There's nothing wrong with declaring the method as a slot, and has the added benefit of allowing users of the class to connect signals to that method. 

 

As for QPointer: I just tried that out with the 10.2 version of the api, and you do not need to explicitly include the QPointer class as long as you're including one of the cascades classes as well (e.g. bb::cascades::Button). If you didn't do that, you'd need to explicitly include the QPointer class as you say. I believe this works the same way in prior versions, since this lab has been around since 10.0, but i haven't checked lately.

Please use plain text.
New Developer
backslash
Posts: 12
Registered: ‎11-10-2011
My Device: Z10
My Carrier: not important

Re: QML and C++ Communication

Problem was, it didn't work for me with that function under public slots. If I invoked it from qml it told me a TypeError: return value is not a function.
The QPointer thing was my fault, I used a forward declaration for all cascades stuff instead of including the headers as the tutorial told me.

But anyway, thanks alot for your reply!!
Please use plain text.