我想在qDebug中组合文本和变量:
QString city_name = "London";
qDebug() << QString("You choose CITY:").arg(city_name);
它不起作用,我不知道为什么。错误是:
QString::arg: Argument missing: You choose CITY:, ?????
答案 0 :(得分:0)
添加%1:
QString city_name = "London";
qDebug() << QString("You choose CITY: %1").arg(city_name);