<div dir="ltr">Hey, <br><br>I get a segmentation fault, when I use an instance of a ListModel in qml. The model is implemented in python, registered with the qml type system. <br><br>In short, adapting the example from the PyQt sources:  "examples/quick/models/abstractitemsmodel". <br><br>------------------------------------------------------------<br>The example creates the model "outside qml", <br><br> model = AnimalModel()<br> model.addAnimal(Animal("Wolf", "Medium"))<br>.<br>and register the object with the rootContext<br><br> ctxt = view.rootContext()<br> ctxt.setContextProperty('myModel', model)<br><br>Using it in qml like this: <br><br>ListView {<br>    width: 200; height: 250<br><br>    model: myModel<br>    delegate: Text { text: "Animal: " + type + ", " + size }<br>}<br><br>----------------------------------------------------------------------<br>When I register the model as a qml type : <br><br> qmlRegisterType( AnimalModel, "AnimalModel", 1, 0, "AnimalModel" )<br> <br>and instantiate in qml like this.<br><br>import AnimalModel 1.0<br>ListView {<br>    width: 200; height: 250<br><br>    model: AnimalModel{ id: animalModel } <br><br>    delegate: Text { text: "Animal: " + type + ", " + size }<br>}<br><br>I get a segmentation fault. <br>------------------------------------------------------------------------<br><br>I admit I do still not have the big golden overview over PyQt5 and Qml,<br>but I think / hope :-) this should be perfectly legal....<br><br>I have attached the adapted example. In two versions. One using the pyrcc for the qml file - exactly like the example :<br><br>abstractitemmodel.py<br>abstractitemmodel.qrc<br>abstractitemmodel_rc.py<br>view.qml<br><br>and one just refer directly to the qml file...<br><br>dmodel.py<br>dview.qml<br><br><br>I am using a fairly new daily snapshot :  PyQt-gpl-5.4-snapshot-15b37c22d541/<br><br><br>Best Regards<br><br><br>Brian.<br><br><br><br></div>