
Originally Posted by
ChrisN
Can anyone tell me the error within the following lines:
QString dT;
dT.clear();
dT.append("Force = %1 +/- %2\n").arg(F,0,'f',0).arg(tolF,0,'f',0);
returns
Force = 10 +/- 2
properly on stdout.
I suspect you are wrong there. What you tested was probably slightly different code. I believe this would work:
dT.append("Force = %1 +/- %2\n".arg(F,0,'f',0).arg(tolF,0,'f',0));
dT.append("Force = %1 +/- %2\n".arg(F,0,'f',0).arg(tolF,0,'f',0));
To copy to clipboard, switch view to plain text mode
or perhaps
dT.
append(QString("Force = %1 +/- %2\n").
arg(F,
0,
'f',
0).
arg(tolF,
0,
'f',
0));
dT.append(QString("Force = %1 +/- %2\n").arg(F,0,'f',0).arg(tolF,0,'f',0));
To copy to clipboard, switch view to plain text mode
(I have trouble predicting when Qt is going to allow auto-conversion of C strings to QStrings.)
Bookmarks