Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.15.0, 5.15.2
-
None
-
Ubuntu 20.04
Description
#include <QGuiApplication> #include <QQmlComponent> #include <QQmlEngine> int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQmlEngine engine; QQmlComponent component(&engine); component.setData( R"(import QtQuick 2.15 Item { width: 640 height: 480 ListModel { id : model } Item { id: a } Component.onCompleted: { model.insert(0, a) } })", QUrl()); QScopedPointer<QObject>(component.create()); return app.exec(); }
This warning is displayed in the log: "<Unknown File>: containmentMask is null. Adding an object with a null member does not create a role for it."
Item.containmentMask is null by default so it automatically triggers this warning.
Tested on Qt 5.12.0 and 5.12.2.
(In the source code of 5.15.0, in /Src/qtdeclarative/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp, there is tst_qqmllistmodel::undefinedAppendShouldCauseError() for this warning)