How to trace the instructions of the code in Qt Creator
Using Visual Studio we could trace each line of the code in C++ to find out the source of a problem. Is these any possibility in Qt Creator please?
Do you mean the debugger ?
Yes I think.
We would use the Debug tab of VS 2015, F11, F10 for step-over and step-into.
Then you have to install the debugging tools provided from the Microsoft web site. Visual Studio comes with an "integrated debugger" that you can't use from the outside.
@tomy Yes, you can debug in QtCreator. If you're using MinGW Qt version then you already can debug. If you're using Microsoft C++ compiler then, as @SGaist said, you first need to install debugging tools from Microsoft.
Thank you two.
Yes I use MinGW and F10 and F11 work but not as expected!
I can't trace the lines of code. :(
I have few functions in My_First_Calculator.cpp that I want to trace the code lines of one method of it but whenever I press F10 or F11 no lines will be traced. That is, it seems useless.
How do you trace your codes please?
Silly question but are you using a debug build ?
@tomy So, you place a break point and start debugging with F5? And it does not stop at the breakpoint? Or it stops there but F10/11 does not work? Or what? Your description is unclear.
Sorry guys, I'm so new in Qt. I apologize for bothering.
I just when into the function I would want to trace its lines and the pressed F11 and F10 like these.
But apparently I should run the app using F5. Is it right? If so how to place a break point? I don't know this?
And will it this way be possible to see the values of variables e.g., chars, string, ints and etc?
Yeah I think I found most of the things.
But another question: Is a
QStringListin Qt equivalent to
QStringListis inherited from
QList<QString>, it does not have relationship with stream.
read QStringList document for more information.
I'm not familiar with
stringstream, but maybe QTextStream is a choice.
by the way, the question is not related to the topic