×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Apr 2008
    Location
    Budapest, Hungary
    Posts
    56

    Unhappy ContactModel does not work

    Hello, I have a problem with Contect model, it does not return anything, but causes a segmentation fault. Can you please help me what can I do to make it work?

    Here I enclose the code:
    Code:
    import QtQuick 1.0
    import QtMobility.contacts 1.1
    
    Rectangle {
        id: main
        width: 360
        height: 360
    
        Flickable {
            id: flickable1
            flickableDirection: Flickable.VerticalFlick
            anchors.fill: parent
            contentHeight: list_view1.height
    
            ListView {
                id: list_view1
                width: parent.width
                height: 300
                anchors.left: parent.left
                anchors.leftMargin: 0
                anchors.top: parent.top
                anchors.topMargin: 0
    
                model: ContactModel {
                    id: cmodel
                    sortOrders:
                    SortOrder {
                         detail: ContactDetail.Name
                         field: Name.firstName
                         direction: Qt.AscendingOrder
                     }
                }
    
                delegate: Rectangle {
                    width: parent.width
                    height: 32
    
                    Text {
                        Component.onCompleted: console.log(ContactDetail.Name)
                        text: ContactDetail.Name
                        font.italic: true
                        font.pixelSize: 15
                        verticalAlignment: Text.AlignVCenter
                        horizontalAlignment: Text.AlignHCenter
                        anchors.fill: parent
                    }
                }
            }
        }
    }
    Here I enclose a printscreen about the error:


    Here I paste the console:
    Code:
    Launching debugger...
    Debugging starts
    limiting remote suggested packet size (131072 bytes) to 16384
    Received too much data from remote target; ignoring overflow.
    while parsing target library list: unclosed token
    I run the it with CODA via WLAN.
    My device's data:
    Code:
    Qt version:
    4.7.3
    OS version:
    Symbian^3, S60 5th Edition Feature Pack 2
    ROM version:
    014.002 2011-03-01 RM-596 (c) Nokia
    Release:
    PR1.2
    CODA version: 
    4.0.21
    QtMobility version: 
    1.1.3
    Screen size:
    360x640
    I would highly appreciate your help.

    Thank you very much again,
    Bálint Molnár

  2. #2
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: ContactModel does not work

    Doest it work on simulator?

  3. #3
    Registered User
    Join Date
    Apr 2008
    Location
    Budapest, Hungary
    Posts
    56

    Re: ContactModel does not work

    Nope, I don't have Mobility installed on my pc so it fails importing QtMobility.contacts 1.1

    BTW thanks for your interest

  4. #4
    Registered User
    Join Date
    Feb 2011
    Posts
    1

    Re: ContactModel does not work

    I have same problem on 4.7.3 qtsdk

  5. #5
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: ContactModel does not work

    Mobility for the simulator comes with Qt SDK. If you don't have 1.1 you maybe have 1.2.

  6. #6
    Registered User
    Join Date
    Apr 2008
    Location
    Budapest, Hungary
    Posts
    56

    Re: ContactModel does not work

    I'll try reinstalling the complete SDK. I'll reply in a few hours what happened.

    Update: reinstalling the sdk did not help, see the post above
    Last edited by molbal; 2011-05-20 at 18:12. Reason: update

  7. #7
    Registered User
    Join Date
    Apr 2008
    Location
    Budapest, Hungary
    Posts
    56

    Re: ContactModel does not work

    I reinstalled the SDK, and I tried it both with the 2.1 and 2.2. It did not work.
    So: reinstalling the SDK does not help
    Last edited by molbal; 2011-05-23 at 17:34. Reason: I made my toughts polite.

  8. #8
    Registered User
    Join Date
    Dec 2008
    Posts
    13

    Re: ContactModel does not work

    I see the same problem while scrolling of long list with images (images sources are from internet, not local)

  9. #9
    Registered User
    Join Date
    Apr 2008
    Location
    Budapest, Hungary
    Posts
    56

    Re: ContactModel does not work

    I think that can be solved by making the buffer bigger. That will preload the images, too.

  10. #10
    Registered User
    Join Date
    Jul 2011
    Posts
    13

    Re: ContactModel does not work

    Hi All,

    ContactModel works. Please check below code snippet:

    import QtQuick 1.0
    import QtMobility.contacts 1.1

    Rectangle {
    id: main
    width: 360
    height: 640

    Flickable {
    id: flickable1
    flickableDirection: Flickable.VerticalFlick
    anchors.fill: parent
    contentHeight: list_view1.height

    ListView {
    id: list_view1
    width: parent.width
    height: 300
    anchors.left: parent.left
    anchors.leftMargin: 0
    anchors.top: parent.top
    anchors.topMargin: 0

    model: ContactModel {
    id: cmodel
    sortOrders:
    SortOrder {
    detail: ContactDetail.Name
    field: Name.firstName
    direction: Qt.AscendingOrder
    }
    }

    delegate: Rectangle {
    width: parent.width
    height: 32

    Text {
    Component.onCompleted: console.log(model.contact.name.firstName)
    id: t1
    text: model.contact.name.firstName
    font.italic: true
    font.pixelSize: 15
    verticalAlignment: Text.AlignVCenter
    horizontalAlignment: Text.AlignHCenter
    anchors.fill: parent
    }

    Text {
    Component.onCompleted: console.log(model.contact.phoneNumber.number)
    text: model.contact.phoneNumber.number
    font.italic: true
    font.pixelSize: 15
    verticalAlignment: Text.AlignVCenter
    horizontalAlignment: Text.AlignHCenter
    anchors.fill: t1.right
    }
    }
    }
    }
    }

    Note: Please add ReadUserData capability to .pro file.

    Best Regards,
    Nikhil V.

Similar Threads

  1. verisign does not work
    By eroslin in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 3
    Last Post: 2008-06-24, 08:55
  2. ActivateLocalViewL does not work
    By lengyuecau in forum Symbian User Interface
    Replies: 4
    Last Post: 2005-06-01, 11:16
  3. EKeyOK does not work!!!
    By serenade in forum Symbian
    Replies: 2
    Last Post: 2004-02-18, 08:09
  4. tag does not work...
    By dtmtraxx in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2002-08-23, 11:55

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×