📜  c++ int to qstring - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:55.944000             🧑  作者: Mango

代码示例2
// Qt 5 + C++11
auto i = 13;    
auto printable = QStringLiteral("My magic number is %1. That's all!").arg(i);

// Qt 5
int i = 13;    
QString printable = QStringLiteral("My magic number is %1. That's all!").arg(i);

// Qt 4
int i = 13;    
QString printable = QString::fromLatin1("My magic number is %1. That's all!").arg(i);