VA uses the format
void f(int x /*= 0*/)
for the default parameter values but this conflicts with Qt's localization tools.
The way VA formats these comments resulted in the following bug, which was quite hard to track down. The code looked as follows:
void Class::func(const char* syntax /*= nullptr*/)
{
initializeStuff(QObject::tr("Initialize network"));
// ...
}
The bug was that this string was never translated when we ran the software. Why was this?
Well, turns out due to the unrelated comment in the line before, Qt thinks that the string has the id "nullptr". Cf. https://doc.qt.io/qt-5/i18n-source-translation.html#adding-meta-data-to-strings. But of course this id is not unique. We have other code that VA formatted this way, e. g. this one:
MyWidget(parent /*= nullptr*/)
: Dialog(tr("My widget"))
{}
So, because there already exists a string with the id "nullptr", Qt will ignore any other string with the same id.
I found a related topic here: https://forums.wholetomato.com/forum/topic.asp?TOPIC_ID=9091. Feline, you mentioned that it's possible to edit the snippets. However, I couldn't find a snippet related to the way the comment is formatted.
My request would be to change the formatting to something like this:
void f(int x/* =0*/)
orvoid f(int x/* =0 */)
in order to avoid the /*=.
Edit: Nevermind. There's a bug report in Qt, and it looks like they fixed it in 5.2. https://bugreports.qt.io/browse/QTBUG-11866 https://bugreports.qt.io/browse/QTBUG-15770