Jonathan Maen
21st January 2012, 09:31
Hello,
I've recently downloaded Qt 4.7 SDK (5 hours ago exactly), and trying it out, I see it's great, but I've came out with this little problem.
QStringQFile
I'm saving a file using QFile and some QStrings, but the strings in the file, are sometimes unrecognizeable, or a bunch of blank spaces.
Also, writting the string is like it isn't triggering the QString.arg() stuff, because I get %1, %2, %3, etc...
This is the code I use (I've just included the lines on which the error appears in the LUA file);
file.write(QString("\t\tdoSetItemActionId(%1, %2)\n").arg(item.Name, item.actionId).toAscii().constData());
file.write(QString("\t\tlocal %1 = doCreateItemEx(cid, %2, %3)\n").arg(item.Name, item.Id, item.Amount).toAscii().constData());
file.write(QString("\t\tlocal %1 = doCreateItemEx(cid, %2, %3)\n").arg(item.Name, item.Id, item.Amount).toAscii().constData());
Please sorry my english grammar, I'm just 17 year old.
I've recently downloaded Qt 4.7 SDK (5 hours ago exactly), and trying it out, I see it's great, but I've came out with this little problem.
QStringQFile
I'm saving a file using QFile and some QStrings, but the strings in the file, are sometimes unrecognizeable, or a bunch of blank spaces.
Also, writting the string is like it isn't triggering the QString.arg() stuff, because I get %1, %2, %3, etc...
This is the code I use (I've just included the lines on which the error appears in the LUA file);
file.write(QString("\t\tdoSetItemActionId(%1, %2)\n").arg(item.Name, item.actionId).toAscii().constData());
file.write(QString("\t\tlocal %1 = doCreateItemEx(cid, %2, %3)\n").arg(item.Name, item.Id, item.Amount).toAscii().constData());
file.write(QString("\t\tlocal %1 = doCreateItemEx(cid, %2, %3)\n").arg(item.Name, item.Id, item.Amount).toAscii().constData());
Please sorry my english grammar, I'm just 17 year old.