DataQualityDecorator.qml Example File
listdecorators/assets/DataQualityDecorator.qml
import bb.cascades 1.0
import bb.cascades.datamanager 1.2
import bb.cascades.decorators 1.2
ActionItem {
ActionBar.placement: ActionBarPlacement.InOverflow
onTriggered: {
dataQualityModel.load()
listView.dataModel = dataQualityDecorator
}
attachedObjects: [
DataQualityModelDecorator {
id: dataQualityDecorator
model:
AsyncDataModel {
id: dataQualityModel
query: DataQualityDataQueryDecorator {
query: SqlDataQuery {
source: _sqlImagesDir + "/../discogs_small.db"
query: "select name, data_quality,primary_image from artist"
countQuery: "select count(*) from artist"
onDataChanged: console.log("data changed: revision=" + revision)
onError: console.log("SQL query error: " + code + ", " + message)
}
}
onLoaded: console.log("initial model data is loaded")
}
}
]
}