Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Is it possible to place a condition inside .arg() of a QString.
e.g. something like this :
@ QString hello = QString("hello %1, how are you") .arg( ?cond? );
?cond? : if (TRUE) { return "Joe" } else { return "Harry" } qDebug() << hello;@
@ QString hello = QString("hello %1, how are you") .arg((TRUE)?QStringLiteral("Joe"):QStringLiteral("Harry"));@
Like that?
Yes, exectly , thank you !
bq. QStringLiteral is a new macro introduced in Qt 5 to create ...
error: 'QStringLiteral' was not declared in this scope
seems not available in Qt 4.8.1 (?)
Hi,
You can use QLatin1String in case of Qt 4.8
yes, the condition was my main problem and this i learned now :)