3 ms·
Is that because your code must be precompiled with moc before it's legal C++? It seems a little unfair to say QtCreator is faster and more accurate if you're w
by DerDangDerDang 9y ago
Is that because your code must be precompiled with moc before it's legal C++? It seems a little unfair to say QtCreator is faster and more accurate if you're working with Qt code. Qt chose to extend the language and make many of their vocabulary types opaque pimpl'd bags of void*, which makes it very hard for any other IDE to support Qt to the same extent.
FWIW CLion also has built-in static analysis.
- deleted 9y ago[deleted]
- jcelerier 9y ago> Is that because your code must be precompiled with moc before it's legal C++? That's... not how moc works at all. Moc parse your header files and generates additional cpp files from it which contain boilerplate for reflection and signals. So no static analyzer has any problem parsing Qt code... (I use cppcheck, coverity, clang-analyzer, clang-tidy) The "special" Qt keywords like signal, slot, etc... are just trivial macros: https://github.com/qt/qtbase/blob/5.10/src/corelib/kernel/qobjectdefs.h#L86 https://github.com/qt/qtbase/blob/5.10/src/corelib/kernel/qo... "signals" is just defined as "public", "slots" and "emit" as nothing. Your compiler compiles your source as-is. If you really don't like moc, there's a way to get its features natively with C++14 compilers (and uglier macros) : https://github.com/woboq/verdigris https://github.com/woboq/verdigris
- DerDangDerDang 9y agoOK, 'legal c++' was a stretch - I take that back. I absolutely stand by the point that it's not reasonable to expect non-Qt tools to work as well as QtCreator on Qt-heavy projects. You don't explicitly say so, but your answer suggests that your project uses Qt heavily. QtCreator is great for Qt projects - fine. That doesn't say much about it in general though. Other IDEs handling a Qt-heavy project less well than QtCreator says nothing about them other than that they can afford to ignore Qt. Thanks for the link to verdigris. It's certainly less offensive than Moc, but if you're forced to use Qt you may as well use Moc.
- jcelerier 9y agoyou seem to think that QtCreator has special cases for Qt code. AFAIK the only specificity is that some icons change on signals during autocompletion, but it works just fine for non-qt projects - it's used quite a bit for development on embedded platforms. the c++ code model is simply its of clang.