Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下内容:
#define versions 0.9.0
我想添加到 QString:
QString str = QString("Software version %1").arg(versions);
这行不通。有谁知道为什么?
谢谢
#define versions "0.9.0"
您忘记在版本号周围加上引号。
你的宏是 C 编码风格,如果你用 C++ 方式编码,使用这个:
const QString versions = "0.9.0";