PDA

View Full Version : Debug issue in QtCreator



jack249
23rd April 2013, 02:26
Sometime when I want to debug a variable, I will see a scene as in the attachment picture.
There are 2 variables have the same name (another 1 has a suffix of "@1") in Locals and Expressions window.
The variable p_data is the variable that I wish to debug.
It is a struct which contain a lot of data (QString, int, double, bool and etc).
The value inside the variable are all random value & the value will not update in the watch window even I've execute some code like

p_data.name = "ABC";
But when I show the data in GUI:

ui->label->setText(p_data.name);
The label is able to show "ABC".
That means the data is successful update into the variable but failed to debug it.
Can I know why will this happened?
Is my coding style got problem?
My Qt version is Qt 4.8.0 for Desktop - MinGW (Qt SDK).

tarunrajsingh
24th April 2013, 03:14
Did you try expanding the arrow before your variable in debug window<see attachment>.Additionally you can right click on variable in debug watch window and set "Add data breakpoint".
8986