I do the following:
1. add this to my .pro file
CONFIG += console
CONFIG += console
To copy to clipboard, switch view to plain text mode
after re-compiling your code, the app should open with a DOS console
2. use qDebug to send output to console
qDebug("show index: %d", myIndexVal);
// or
qDebug() << "show index: " << myIndexVal;
qDebug("show index: %d", myIndexVal);
// or
qDebug() << "show index: " << myIndexVal;
To copy to clipboard, switch view to plain text mode
Using the latter option: I think you have to #include <QDebug> (not sure, i rarely use it).
Bookmarks