11-03-2012 12:57 PM
As per title
Any way of forcing line breaks in SystemDialog body text ?
Tried putting \n in the text + the \n simply gets displayed.
Dont appear to be ablet to put break tags in the text - the momnetics language resource file destroyer does not like the tags .
Solved! Go to Solution.
11-05-2012 03:34 PM
This worked for me:
body: "Message Body \n blah\n\nNewlines FTW!"
Are your SystemDialogs being displayed correctly? Look at http://supportforums.blackberry.com/t5/Cascades-De
11-07-2012 03:43 AM
Thanks for the hint!
What seems to be going on is
i) if you pass the setBody() method a string literal - as in setBody("line1 \n line 2") all is well
ii) from prev poster, if you set body text via a QML file the \n is processed correctly (not verified, but believe prev poster)
If you load the text from a TS file, as in setBody(QApplication::translate("","String Reference")); and the string in the TS file contains the \n characters - the new line does not appear - the '\' and 'n' chars are displayed instead. This is despite the procecssing of the TS files
To have newlines in the TS file use the
encoding (instead of the \n)
Note. The TS file mangler will proceed to mangle your TS file containing the
and replace it with an actual new line in the xml text - so that may well be the alternate soln - simply put a new line in your text. But relying on some dubious bit of xml file text formatting seems unreasonable.....
So weve gone for a %argNum approach and used a QString.arg()
and used a String str = tsFileString.arg(QString("\n"));
as we already have to use the QString.arg() on this particular string anyway.