How to deal with “%1” in the argument of QString::arg()?

前端 未结 3 639
花落未央
花落未央 2020-12-09 02:36

Everybody loves

QString(\"Put something here %1 and here %2\")
    .arg(replacement1)
    .arg(replacement2);

but things get itchy as soon

3条回答
  •  失恋的感觉
    2020-12-09 02:54

    See the Qt docs about QString::arg():

    QString str;
    str = "%1 %2";
    str.arg("%1f", "Hello"); // returns "%1f Hello"
    

提交回复
热议问题