Search code examples
c++macosqtcompilation

How qt find <Qxxx/qxxx.h>?


In Qt 6.4.0, we can use such code to include qt components:

#include <QtCore/qchar.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qbytearrayview.h>
#include <QtWidgets/qtwidgetsglobal.h>

But I found that the real paths of those .h file are NOT under such folder like QtCore, QtWidgets etc. , actually most of them are under such directory: /Users/tony/Qt/6.4.0/macos/lib/QtXXX.framework/Headers/qtxxx.h

I'm wondering that since QtCore is not the real path but Headers, Shouldn't we write #include "Headers/qtxxx.h" ? how can #include <QtCore/qchar.h> such path works?


Solution

  • It's been solved: This phenomenon only shows on MacOS since MacOS uses "framework" to organize a set of lib and headers, which can be parsed by the clang-module name to the realpath.