Results 1 to 3 of 3

Thread: itemChange() glibc invalid pointer

  1. #1
    Join Date
    Feb 2008
    Posts
    102
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question itemChange() glibc invalid pointer

    I reimplement the itemChange funciton in my custo QGraphicsItem.

    Qt Code:
    1. QVariant rectItem::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value){
    2. std::cout<<"item "<<type()<<" change"<<std::endl;
    3.  
    4. QGraphicsRectItem::itemChange(change,value);
    5. }
    To copy to clipboard, switch view to plain text mode 

    When i execute the program, i get this error after I insert an item in my scene........
    "*** glibc detected *** ./qt_program: free(): invalid pointer: 0xbfa28b50 ***"

    What's wrong with the implementation? Without the ridefinition of this function, the program works well..........


    GDB gives me this error:
    "Program received signal SIGSEGV, Segmentation fault.
    0xb7e52ab6 in ?? () from /usr/lib/libQtGui.so.4"
    Last edited by dreamer; 3rd May 2008 at 09:58. Reason: updated contents

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: itemChange() glibc invalid pointer

    I guess line 4 should be -

    Qt Code:
    1. return QGraphicsItem::itemChange(change,value);
    To copy to clipboard, switch view to plain text mode 

    hope am right

  3. The following user says thank you to aamer4yu for this useful post:

    dreamer (3rd May 2008)

  4. #3
    Join Date
    Feb 2008
    Posts
    102
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Thumbs up Re: itemChange() glibc invalid pointer

    yes, you are right.........

Similar Threads

  1. Client/Server Error: BadIDChoice
    By 3nc31 in forum Qt Programming
    Replies: 5
    Last Post: 27th November 2007, 11:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.