Il 07/05/2018 20:24, Christian Ehrlicher ha scritto:
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...

The documentation doesn't talk about QArgument, but about Q_ARG and Q_RETURN_ARG, which is what you should use.

(Under the hood, the problem is that QArgument simply stores a pointer to your variable. If that variable is a temporary, that pointer becomes immediately dangling. For this reason, do not store what Q_ARG builds, e.g. in an variable declared auto!)

HTH,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

Attachment: smime.p7s
Description: Firma crittografica S/MIME

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to