#include <QtQml/qqml.h> vs #include <QtQml>
-
I've been trying to discover why some of my C++ classes (QML extensions) are working fine and some are not. The difference seems to be whether I
#include <QtQml/qqml.h>or#include <QtQml>.Both cause
QML_ELEMENTto be correctly colour-coded in the C++ class in Qt Creator.
Both build without issues.But only
#include <QtQml/qqml.h>results in correct colour-coding of the component in QML (after build) and runs without issues.For some reason
#include <QtQml>results inUnknown component . (M300)error in QML (after build) and on run gives the error "Xxxxx is not a type".I thought that
#include <QtQml>would include all parts of QtQML includingqqml.h. Can anyone explain is this a bug in Qt or in my understanding? -
This sounds like a bug. I suggest creating a bug report for it, including a minimal example.