Christian Ehrlicher
2018-05-07 18:24:55 UTC
Hi,
today I discovered that Q_QArgument does not handle a temporary
(boolean) value as I would have expected it.
I'm invoking the method similar to this:
QArgument<bool> arg3("bool", !inProgress);
request.replySlot.invoke(m_objToInform, Qt::QueuedConnection, arg1,
arg2, arg3);
Changing it to
bool bFinished = !inProgress;
QArgument<bool> arg3("bool", bFinished);
fixes the problem but I'm not sure if the compiler can maybe optimize it
away...
I did not found a hint int the documentation about this behavior.
Therefore my question - should this work for a queued connection or not?
At least msvc2017 and gcc 4.8 don't like it when compiling with -O2...
Thx,
Christian
today I discovered that Q_QArgument does not handle a temporary
(boolean) value as I would have expected it.
I'm invoking the method similar to this:
QArgument<bool> arg3("bool", !inProgress);
request.replySlot.invoke(m_objToInform, Qt::QueuedConnection, arg1,
arg2, arg3);
Changing it to
bool bFinished = !inProgress;
QArgument<bool> arg3("bool", bFinished);
fixes the problem but I'm not sure if the compiler can maybe optimize it
away...
I did not found a hint int the documentation about this behavior.
Therefore my question - should this work for a queued connection or not?
At least msvc2017 and gcc 4.8 don't like it when compiling with -O2...
Thx,
Christian