How to debug / verify running Qt code ?
-
The attached snippet of code has three tasks, performed in sequence
close QMdiSubwindow
Cascade all QMdiSubwindows
Tile all QMdiSubwindowsI can observe, in real time,
event->accept(); - subwindow closes
if I skip processAction(3,"actionTile");
by commenting it out
I can also observe
processAction(3,"actionCascade");however
if I uncomment
processAction(3,"actionTile");
I can observe
event->accept();
and
processAction(3,"actionTile");BUT
it is NOT what I expect
it still have place of the original closed subwindow.
At thus point I do not know why the result is not what was expected
and need an easier way to debug the process.My questions
is there a SIMPLE way to let the running code display each step as it happen?
Ideally adding a delay between each step - for debugging purpose.Adding this delay just delays the entire code completion
QObject().thread()->usleep(100010005);What I like to have is this
'```
// Accept the event to allow the window to close
event->accept(); // TOK
delay /show the above
processAction(3,"actionCascade"); // TOK
delay /show the above
// debug real time
// QObject().thread()->usleep(100010005);
processAction(3,"actionTile"); // ???
delay /show the aboveI suspect QProcess is the answer, but that is not what I would call a simple solution. I am open to reasonable suggestions. Thanks '``` // Accept the event to allow the window to close event->accept(); // TOK processAction(3,"actionCascade"); // TOK // debug real time QObject().thread()->usleep(1000*1000*5); processAction(3,"actionTile"); // ???
-
This post is deleted!