Important: Please read the Qt Code of Conduct -

Crash Application when I using QAbstractListModel as subclass to custom ListModel

  • Hi everyone!

    I need help with QAbstractListModel. I develop application where I need show items as tree. I use QML component from "here": I've created the model list object as subclass QAbstractListModel. All works fine, but when I try to change model to another model application calls crash.

    When items need to update I'm creating a new model object and send signal to QML component where I call this:
    @Component.onCompleted: {

    function updateFields(obj)
    var list = createNewController.newItem.toPropertiesListModel();
    console.log("ssss: "+list.getItem(0).path);
    propertiesTable.model = list;

    TreeView {
    id: propertiesTable
    width: parent.width
    height: parent.height - 30
    model: createNewController.newItem.toPropertiesListModel()

    onModelChanged: {

    removeSelectedProperty.enabled = (model !== null && model.length > 0);
    onCurrentItemChanged: {
    console.log("parentPath: "+currentItem.node.path);
    propertiesSettingsPanel.propertyValue.text = currentItem.node.value;

    Could you tell me when I can find samples about QAbstractListModel? Thanks!

  • Try Qt example.

  • [quote author="Vincent007" date="1387375127"]Try Qt example.

    Thanks I will check!

Log in to reply