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
Contributor
Posts: 44
Registered: ‎01-22-2013
My Device: Z10, Q10, Z10 Alpha
My Carrier: None

Debugging Issues

Hi,

 

I am trying to debug a native app on the BB10 but I am finding that I cannot see the contents of my variables etc in the eclipse debugger.

 

EG : I have a QVariantList and when looking at it all I get in eclipse is this

 

Details:QVariant types printing not supported

 

Anyone any ideas how I can view the contents of these variables as at the moment it is impossible to debug stuff without actually being able to see the data.

 

Thanks

 

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Debugging Issues

[ Edited ]

By definition a QVariant can hold any type of variable type and therefore would be extremely difficult for a debugger to interpret what variable is contained within.

 

What I do is output using qDebug() and if necessary cast to the type within this call.

 

As a note QVariants are useful for passing variables that are truly polymorphic such as QML passing a value that can be represented as text, int or a hex value to C++, but there are overheads associated with this so where possible you should use a specific data type if possible.

 

 

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Contributor
Posts: 44
Registered: ‎01-22-2013
My Device: Z10, Q10, Z10 Alpha
My Carrier: None

Re: Debugging Issues

Thanks for response.

 

The module I am writting at the moment is actually the Contact retrieval so using QVariants seemed like the best option.  Might have a rethink about this one though.

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Debugging Issues

I'm not saying don't use them just be mindful of the overhead if you are going to do a lot of processing on them.

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.