What is the equivalence for QString::arg() in QML
问题 I'm wondering How I can have a string in QML that will be occupied with some arguments? Some thing like this in Qt: QString str("%1 %2"); str = str.arg("Number").arg(12);//str = "Number 12" 回答1: In QML environment, the arg() function already added to the string prototype, so basically you can use the string.arg() in QML just like C++. There is less documentation about this, but I'm sure it works in Qt 4.7 + QtQuick 1.1 Take at look at the Qt 5 doc : http://qt-project.org/doc/qt-5.0/qtqml/qml