April 3, 2012

dj3mb3 dj3mb3
Lab Rat
7 posts

QContact & QObject

 

Hi,

I’m trying to binding QContactManager class to QML but I discovered that QContact doesn’t extend QObject so it’s a bit tricky
Can you explain me the main reason about this? Actually I really don’t undestand.

I don’t want to use QML ContactManager cause I don’t need my data to be redundant and I want take them and their management into the c++ side.

Nowadays I’m playing with QDeclaratveContactManager but I think a nicer solution should exists.

any suggestions?

thanks

1 reply

May 3, 2012

cristiano cristiano
Lab Rat
2 posts

Hi!

dj3mb3 wrote:
Hi, tricky

I’m trying to binding QContactManager class to QML but I discovered that QContact doesn’t extend QObject so it’s a bit tricky
Can you explain me the main reason about this? Actually I really don’t undestand.

I think the main reason has been about keeping the QContact abstraction simple. THere has been no need so-far to turn it into a QObject, and that made the single QContact instances more lightweight when it comes e.g. to memory consumption and performance. The Contacts API should be designed to handle huge volumes of Contact objects, and making QContact a QObject specialization would result in increased overhead for construction and destruction of significant numbers of objects.

dj3mb3 wrote:
I don’t want to use QML ContactManager cause I don’t need my data to be redundant and I want take them and their management into the c++ side.

Nowadays I’m playing with QDeclaratveContactManager but I think a nicer solution should exists.

any suggestions?

You have a valid point here, since I also see the need for manager-like kind of elements in the QML side of Contacts API. Concretely, I would like to see a declarative contact manager element in the QtContacts land, maybe coupled / paired with a few new model elements e.g. a lighter and more efficient ContactListModel element not having any “manager” functionality, but just a plain and fast list model for QML clients. With the existing QContactManager C++ interface, I assume the only way to go for you would be to create such a QDeclarativeContactManager.
I encourage you to propose something via our codereview project (qtpim). Once we have a first proposal, we can work from there and try to create together such new elements for Qml QtContacts 5.1 API.
I think discussing this topic on the qtproject development mailing list (development_at_qt-project.org) would be beneficial.

Cheers,
-Cristiano

 
  ‹‹ Fix for black screen in android      Qt Embedded && TouchScreen ››

You must log in to post a reply. Not a member yet? Register here!