Better_Software_Header_MobileBetter_Software_Header_Web

Find what you need - explore our website and developer resources

Using QAbstractItemModel with Cascades on BB10

import bb.cascades 1.0
import com.kdab.components 1.0

Page {
    attachedObjects: [
        AbstractItemModel {
            id: abstractItemModel
            sourceModel: _fileSystemModel
        }
    ]

    ListView {
        dataModel: abstractItemModel

        listItemComponents: [
            ListItemComponent {
                type: ""
                StandardListItem {
                    title: ListItemData.display
                }
            }
        ]
    }
}
AbstractItemModel {
    id: abstractItemModel
        sourceModel: _myCustomModel
        itemTypeRole: "itemType"
    }
ListView {
        id: listView

        dataModel: abstractItemModel
        onTriggered: {
            listView.rootIndexPath = indexPath
            abstractItemModel.fetchMore(indexPath)
        }

        ...
    }

1 Comment

2 - May - 2013

BWA