×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jan 2009
    Location
    ભારત->ગુજરાત->ભાવનગર
    Posts
    279

    Question Thread has crashed: A data abort exception has occurred accessing 0x0.

    Hi,
    I am trying to retrieve contact list , the code is shown below

    Code:
    void MainWindow::viewDetails(QContactManager* cm )
       {
           QList<QContactLocalId> contacts = cm->contactIds();
           QList<QContactLocalId>::iterator it;
           for (it = contacts.begin(); it != contacts.end(); ++it)
           {
             QContact contact = cm->contact(*it);
             qDebug() << "Name: " << contact.displayLabel();
    
           }
       }
    When execution comes within this function i face Segmentation fault and Error Displayed is Thread has crashed: A data abort exception has occurred accessing 0x0.

    Any Suggestions??
    Regards
    Viral Parmar

  2. #2
    Registered User
    Join Date
    Jan 2009
    Location
    ભારત->ગુજરાત->ભાવનગર
    Posts
    279

    Re: Thread has crashed: A data abort exception has occurred accessing 0x0.

    I have solved the problem of Segmentation fault with a lil bit change in code...

    void MainWindow::viewDetails()
    {
    QList<QContactLocalId> contacts = cm->contactIds()

    // Now iterate
    QList<QContactLocalId>::iterator it;
    for (it = contacts.begin(); it != contacts.end(); ++it)
    {
    QContact contact = cm->contact(*it);
    // And print contact information...

    qDebug() << "Name: " << contact.displayLabel();
    //<< " Number: " << conta << " ";
    }
    }
    I have declared QContactManager Object Globally .

    It works..
    Regards
    Viral Parmar

Similar Threads

  1. Replies: 6
    Last Post: 2010-06-16, 09:21
  2. Replies: 4
    Last Post: 2009-12-11, 09:43

Posting Permissions

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