I am currently playing around with QStrings in QT and can't seem to understand why the following code is not working for me.
#include <QCoreApplication>
#include <QDebug>
#include <QString>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QString test;
int x = 5;
test.append("This is a test of the Arg Function %1").arg(x);
qDebug() << test;
//should output This is a test of the Arg Function 5
return a.exec();
}
The output I am getting is:
This is a test of the Arg Function %1
Obviously I am expecting the value 5 to replace the %1, am I missing something obvious here?