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: 51
Registered: ‎11-23-2012
My Device: BB10 Dev Alpha
My Carrier: GiffGaff

Debugging QML

Hi,

 

I've just started working with BB10 Cascades and QNX Momentics.  I've used Qt/QML before on other platforms and the debugging in Qt Creator worked well.  According to this:

https://developer.blackberry.com/cascades/documentation/getting_started/tools/debug_and_profile.html

it should just work in the Momentics IDE too but any breakpoint I set in QML just gets ignored while I'm debugging - breakpoints in C++ code work fine.  Anyone else have this problem?  Are there some settings/config I'm missing?

 

Thanks,

Mark

 

Developer
Posts: 51
Registered: ‎11-23-2012
My Device: BB10 Dev Alpha
My Carrier: GiffGaff

Re: Debugging QML

Bumping my own post...

 

In the known issues for beta 4 I found this:

"To debug sample projects that are loaded through the QNX Momentics IDE, debug code needs to be added to main.cpp. Newly created projects do not need enable debugging. 
Workaround: If you're debugging based on a sample project, the debug code needed in main.cpp is putting #include <Qt/qdeclarativedebug.h> before the main() function."

 

This suggests that QML debugging ought to be working for some people at least.  I tried adding the mentioned header to my main.cpp file as suggested for sample projects and it didn't make any difference - doesn't work on simulator or device.

 

Are projects which can't use the QML viewer due to unrecognised imports also unable to debug QML/JS?

 

Does anyone have QML/JS debugging working?

 

Highlighted
Developer
Posts: 132
Registered: ‎11-06-2012
My Device: BlackBerry Passport

Re: Debugging QML

Right now, in my knowledge, there is no way to debug in QML.

All you can do is to log the result or anything to Terminal (SSH from your Target) to see it.

 

This is my debug QML code. Hope it can help you Smiley Happy

 

function logToConsole(message) {
        message = "\n**************\n" + message + "\n**************\n";
        console.log(message);
  }

 

Developer
Posts: 51
Registered: ‎11-23-2012
My Device: BB10 Dev Alpha
My Carrier: GiffGaff

Re: Debugging QML

[ Edited ]

Thanks - I'm already doing much the same.  It's just having had this working in Qt Creator on other platforms plus these from the link in my first post on the thread:

"Debugging is now supported for both C++ and QML/JavaScript."

"In an application that contains both C++ and QML the debugger is able to pass back and forth between the two."

...well, it got me all hopeful of working tools. Smiley Happy

 

Anyone from RIM confirm this doesn't actually work right now?  In which case it'd be good to fix the docs so we don't all waste time trying to figure out what's wrong with our environment.