Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.1.0
-
None
-
Jolla Sailfish 1.0.3.8 (Qt 5.x), QtContacts 5.x
Description
I have come across some strangeness using QtContacts 5.0 on Sailfish.
For various reasons partially lost in the mists of time, I copy contacts (or rather a subset of contract roles) from the ContactModel to a a normal ListModel.
One of the roles copied is "phoneNumbers". This has a child property "length" indicating the number of phoneNumbers available for the contact.
phoneNumbers.length is available (defined) direct from the ContactModel, but is undefined when I try to use it from the ListModel. So the console.log in the function appendContact() gives a valid result, but the console.log in populate() gives undefined.
Other properties, including the phone numbers in phoneNumbers are defined when accessed from the ListModel.
Equivalent code works in Haramtatan / Qt 4.7.4 Mobility 1.2
import QtContacts 5.0
.....
ContactModel
{ id: phoneContactsModelInternal } ListModel {
id: localContactModelInternal
function populate() {
clear();
for (var i = 0; i < phoneContactsModelInternal.contacts.length; i++)
}
function appendContact(contact) {
localContactModel.append(
);
console.log("appending: " + contact.displayLabel.label + ", numbers: " +
contact.phoneNumbers.length)
}
}