1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
import Test
import QtQml
VariantAssociationProvider {
property string variantMapEmailBeforeDelete: ""
property string variantHashEmailBeforeDelete: ""
property bool mapDeleteReturnedTrue: false
property bool hashDeleteReturnedTrue: false
property bool deleteOfNonExistingThrew: false
Component.onCompleted: {
variantMap.email = "foo@bar.com"
variantMapEmailBeforeDelete = variantMap.email
mapDeleteReturnedTrue = delete variantMap.email
variantHash.email = "foo@bar.com"
variantHashEmailBeforeDelete = variantHash.email
hashDeleteReturnedTrue = delete variantHash.email
try {
delete variantMap.nonexisting
delete variantHash.nonexisting
} catch (_) {
deleteOfNonExistingThrew = true;
}
}
}
|