[cfe-dev] The QtReslot Clang plugin
Sérgio Martins via cfe-dev
cfe-dev at lists.llvm.org
Wed Feb 15 09:55:13 PST 2017
On Tue, Feb 14, 2017 at 7:33 PM, Richard Braun via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
> Hello,
>
> During work on an internal Qt-based project at Novasys-Ingenierie,
> a Clang plugin was written to convert string-based signals and slots
> to the Qt5 syntax. The plugin has since been pushed to Github [1]
> in the hope it will be useful to others facing similar issues.
Hi Richard,
Beware that the new PMF syntax is not a drop in replacement for the old style.
Applying these fixits on a codebase might introduce bugs.
Here's some things to watch out for:
- You can't disconnect with new-syntax if the connect was made with
old-syntax (and vice-versa)
- Difference in behaviour when calling slots of partially destroyed
objects (explained in <https://codereview.qt-project.org/#/c/83800>,
not sure if it will be merged. <- Thiago ??)
- Old style is capable of making functions "virtual" without using the
virtual keyword.
Just for fun, can you run your plugin on clazy's unit-tests
(clazy/tests/old-style-connect/*.cpp) and compared them to
*fixed.cpp.expected, to see if it converted the connects correctly ?
Regards,
Sérgio Martins
More information about the cfe-dev
mailing list