Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QML type error.
Ankit.Jain last edited by
I have a code base using QML. Upon running it, I get some errors (the code runs anyway and it is successfully reading the values as well).
The error is something like:
TypeError: Cannot read property 'something' of undefined
This error is coming up when I try to access "something" from class "A" which is present in a QQmlListProperty "listOfA" present in class "C" set as context property under name "c" with namespace "namespace" version "1.0"
So, I'm effectively typing:
- I currently have a Q_PROPERTY for a QQmlListProperty<A> type object.
- I have a qmlRegisterType decleration for A:
qmlRegisterUncreatableType<A>("namespace", 1, 0, "A", "Cannot create an object of type A");
- The qml class linked in the error imports namespace 1.0
Might I be suggested what I am missing here?
such errors appear when you try to access
c.listOfAtoo early before it has a proper value assigned