Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
5.1.0 , 5.2.0
-
None
-
Mingw32, Windows XP (Doesn't crash on Linux OpenSuse x86_64 (though it doesn't work either))
Description
I have a little sample program that shows the problem.
It exposes a MyClass object to Qml (rootContext->setContextProperty("myObject", myClass))
MyClass has a property named list (declared with Q_PROPERTY) and its type is QList<LittleObject*> (with class LittleObject : public QObject
{...})
When I try to set a Repeater model to that property (Reapeater
{model: myObject.list}), it crashes on an assert :
ASSERT: "list.type() != QQmlListAccessor::Instance" in file util\qqmladaptormodel.cpp, line 931
If the list property is of type QList<QObject*> and the method list returns QList<QObject*>, Qml accepts it and even gives access to the LittleObject* objects in the list (this is shown with the property list2)
QList<LittleObject*> is of course registered as a metatype.
I don't want to use QQmlListProperty (because I don't need it, I only use constant QList's)
Attachments
Issue Links
- is replaced by
-
QTBUG-34999 ListView asserts when a null model is assigned from a QObject derivative typed property.
- Closed