Thanks!
1. What if I have got several different things which I'd like to output to qDebug? Those are in different parts of the code but are short enough to be stored in one single line. In other words, is there any way to write "qDebug << backspace_character" in order to delete CR/CL characters of new line?
2. And the second question, more connected with object-oriented programming. I've got files created automatically by QT Creator: main.cpp, mainwindow.h, mainwindow.cpp. There are also files which I have added: mydata.h, mydata.cpp. In the file mydata.cpp I have function breadth() for breadth search algorithm. I use qDebug() inside this breadth() function. However I use it many times in different places of the code. What if I wanted to use one function, e.g. showDebugInfo(variables which are declared inside the breadth function to be given by reference) and call it inside breadth() function? I mean, where should I declare this showDebugInfo(...) function? (Because it would be like function called from inside the function which is method of the class - it makes me confused). And how to give those other variables as reference to that function? I've got such a code at this moment:
Qt Code:
qDebug() << "Value of n = " << n; qDebug() << "distances: " << distances; //...To copy to clipboard, switch view to plain text mode
where distances is QList<int> distances; and there are more lists like this in my qDebug part of the code.
Regards!
Bookmarks