03-28-2013 07:18 AM
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.
03-28-2013 08:18 AM - edited 03-28-2013 08:22 AM
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.
03-28-2013 08:25 AM
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.
03-28-2013 09:39 AM