03-06-2013 02:06 PM
I'm just wondering if anyone knows how to view Qt containers in a human readable way under debug?
So ie if I have QString str("hello") under debug i wanna see "hello" as a value of str instead of bunch of pointers
Solved! Go to Solution.
03-06-2013 07:05 PM
03-06-2013 07:59 PM - edited 03-06-2013 09:59 PM
Yes you can have the QNX Momentics IDE debugger show the string in the variable window neatly.
Window->preferences->C/C++->debug->GDB and make sure "pretty printing" is enabled
Make a file called .gdbinit in your project root folder and put this in:
from qt4 import register_qt4_printers
Then copy the qt4.py file from: https://projects.kde.org/projects/extragear/kdevel
Put that file in the same working directory (the project directory). Or you can put it somewhere else, and replace the "." in "sys.path.insert(0, '.')" with the folder containing the qt4.py
Next time you run the debugger, it should show the QString.
If you have any problems (it doesn't work), you can check out the gdb trace console, and the gdb console (try: source .gdbinit) to see any errors.
I have yet to do this with the dinkum STL. I just started.... PM me if you want the instructions once I'm done...
p.s. Special thanks to the kdevelop team that made this python module.
edit: removed set print pretty line in .gdbinit. set up properly by qnx ide.
03-14-2013 03:30 PM
I created a github repository for Dinkum/QNX/Blackberry STL printers described here: