[Qt-creator] Handling of Qt frameworks in the combination of clang code model and generic project manager

Andreas Pakulat apaku at gmx.de
Tue Feb 7 15:20:53 CET 2017


I've just rebuilt QtC from master enabling the clang code model
(didn't notice I did not use that when I provided my last set of
patches for the generic manager) and found that the parser complains
about finding some Qt headers. For example #include <qglobal.h> leads
to a warning that inside qglobal.h the #include <QtCore/qconfig.h>
cannot be resolved. I'm using Qt4.8 for that project.

Now I don't know all that much about how frameworks on macOS work, but
I suspect that the QtCore/qconfig.h is being resolved by the compiler
correctly because the buildsystem in question tells the compiler that
QtCore.framework is a framework (passing -F <path-to-qt>/lib
-framework QtCore).

For QtCreator's generic project manager I'm using this to make it find
headers like qglobal.h:
However that way QtCreator does not know its a framework and that it
should handle it as a framework. Hence it will not find the #include
<QtCore/qconfig.h> since there's no such relative path in the
QtCore.framework/Headers directory.

I can workaround the problem by creating symlinks, for example QtCore
-> QtCore.framework/Headers in the lib/ directory of the qt

I wonder though; Would it be possible that QtCreator detects that one
of the given entries is a framework and pass this information on to
the clang code model (and likely eventually libclang) so that the
include-resolving happens the same way it works during compilation?


More information about the Qt-creator mailing list