Originally Posted by
MarkoSan
I have this system everywhere in project and it works fine, just here it does not work. So, how should I rewrite the code, have you any clues?
Give yourself a moment to think it. Consider the following piece of pseudo code:
{
// does not modify _this_ but returns a copy
copy.replacePlaceHolderWithValue(value);
return copy;
}
QString QString::arg(value) const
{
// does not modify _this_ but returns a copy
QString copy(*this);
copy.replacePlaceHolderWithValue(value);
return copy;
}
To copy to clipboard, switch view to plain text mode
What's the content of foo?
foo.arg(1234);
QString foo("%1");
foo.arg(1234);
To copy to clipboard, switch view to plain text mode
What's the content of bar?
bar = bar.arg(5678);
QString bar("%1");
bar = bar.arg(5678);
To copy to clipboard, switch view to plain text mode
Bookmarks