Solved How to use __LINE__ macro as QString parameter ?
-
This is driving me nuts - how use LINE macro (int) as QString parameter ?
The compiler likes it but the result is wrong.QString label = QString(__LINE__ ); //current code line ui->chat_2->append(label); // no good
-
@AnneRanch said in How to use __LINE__ macro as QString parameter ?:
QString label = QString(LINE ); //current code line
use QString::number
QString label = QString::number(__LINE__ ); -
@AnneRanch said in How to use __LINE__ macro as QString parameter ?:
how use... (int) as QString parameter ?
-
P.S. This thread is about how to use a Qt-specific class (QString), so it does not belong in the "C++ Gurus" subforum (which is for questions about C++ concepts and techniques).
Moved to the "General and Desktop" subforum.
-
@AnneRanch said in How to use __LINE__ macro as QString parameter ?:
QString label = QString(LINE ); //current code line
use QString::number
QString label = QString::number(__LINE__ );