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
neilhogg69
Posts: 34
Registered: ‎05-11-2012
My Device: Bold 9900
My Carrier: Vodacom
Accepted Solution

How to debug Native/Cascades

[ Edited ]

Hello

 

I am still really new to the Native/Cascades blackberry development so sorry for the noob question. I cannot figure out how to make a simple log to the console when actions are performed like clicking a button. Do i use the cout function of C++ or does QT have a special logging function?

 

Any and all help is appreciated!

Please use plain text.
Developer
filiussoft
Posts: 106
Registered: ‎06-18-2009
My Device: Bold

Re: How to debug Native/Cascades

[ Edited ]

Yea, I wondered that at first too.

 

If you handle the click event in your C++ code, you can use QT's QDebug.

 

    qDebug() << "Button Clicked - Car Year selected:" << car->getYear();

 You will have to include QDebug.

 

#include <qdebug.h>

 For reference:

https://bdsc.webapps.blackberry.com/cascades/reference/QDebug.html

http://qt-project.org/doc/qt-4.8/qdebug.html

 

Does anyone else use something different / is there a better way to do logging during debug?

----
If this helped you, press the thumbs up button (on the far right - '+' thumb icon)
If this post solved the issue, click "Accept as Solution"
Please use plain text.
Developer
neilhogg69
Posts: 34
Registered: ‎05-11-2012
My Device: Bold 9900
My Carrier: Vodacom

Re: How to debug Native/Cascades

Thank you so much! This is going to help me work much faster! I really hope they improve the cascades documentation.

Please use plain text.
Developer
sketch34
Posts: 54
Registered: ‎05-23-2012
My Device: Developer
My Carrier: Developer

Re: How to debug Native/Cascades

I get no output when using qDebug(), either in the console or the log file. I've included qdebug.h.

 

Are there any libs we also need to include?

----
I know exactly where the problem *might* be.
Please use plain text.
Developer
sketch34
Posts: 54
Registered: ‎05-23-2012
My Device: Developer
My Carrier: Developer

Re: How to debug Native/Cascades

Please use plain text.