[SailfishDevel] QtContacts: phoneNumbers.length attribute gets lost when copied to ListModel

christopher.lamb at thurweb.ch christopher.lamb at thurweb.ch
Fri Feb 28 06:13:10 UTC 2014


Hoi Matthew

Thanks. I have now raised this bug report:

https://bugreports.qt-project.org/browse/QTBUG-37139

Funnily, at least one of reasons "lost in the mists of time" is a  
previous bug report I raised at the start of the year:

https://bugreports.qt-project.org/browse/QTBUG-35276

Grüsse

Chris


Zitat von "Matthew Vogt" <matthew.vogt at jolla.com>:

> Hi Chris.  This sounds like a regression in the (unfinished) qtpim  
> module of Qt 5, which reimplements the functions provided by  
> QtContacts in QtMobility.
>
> You can report bugs against this module here:  
> https://bugreports.qt-project.org/browse/QTBUG/component/19726
>
> Thanks,
> Matt
> ________________________________________
> From: devel-bounces at lists.sailfishos.org  
> [devel-bounces at lists.sailfishos.org] on behalf of  
> christopher.lamb at thurweb.ch [christopher.lamb at thurweb.ch]
> Sent: Thursday, February 27, 2014 8:09 PM
> To: Sailfish OS Developers
> Subject: [SailfishDevel] QtContacts: phoneNumbers.length attribute  
> gets lost    when copied to  ListModel
>
> Hi All
>
> 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 ++) {
>                  appendContact(phoneContactsModelInternal.contacts[i]);
>                  console.log("checking number of phoneNumbers: " +
> localContactModel.get(i).phoneNumbers.length);
>              }
>          }
>          function appendContact(contact) {
>              localContactModel.append({"contactId": contact.contactId,
>                                    "displayLabel":  
> contact.displayLabel.label,
>                                    "phoneNumbers": contact.phoneNumbers,
>                                    "phoneNumbersCount":
> contact.phoneNumbers.length});
>              console.log("appending: " + contact.displayLabel.label +
> ", numbers: " + contact.phoneNumbers.length)
>          }
>      }
>
> Any ideas?
>
> Chris
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> _______________________________________________
> SailfishOS.org Devel mailing list
>





More information about the Devel mailing list