Results 1 to 17 of 17

Thread: QCanvasPolygonalItem delete and SegFault or pure virtual call

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2006
    Location
    istanbul, turkey
    Posts
    42
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question QCanvasPolygonalItem delete and SegFault or pure virtual call

    Hi to all,
    I have list of QCanvasPolygonalItems which should be deleted when user wants to do so. As QT docs stated i used hide() in my derived class destructor then sometimes i started getting pure virtual func call errors or just segfaults. But after i dig into google about this problem, i found that it says that hide needs areaPoints() (i think it will be called sometime afterwards) which is pure virtual at base class. since virtual functions in c++ behave different than java and c#; using virtual functions is not recommended at constructors and destructors. But obviously i only used hide() in my destructor. And QT says hide() must be called. How can i delete preventing pure virtual func called or segfault. Exactly same problem was reported to trolltech at the below links:

    http://lists.trolltech.com/qt-intere.../msg00692.html

    as stated before problem appears when i try to delete qcanvaspolygonalitems.

    Note: i also tried to call hide() before deleting the object. but this didn't solve the problem.
    Last edited by hayati; 12th March 2008 at 14:21.

Similar Threads

  1. QItemDelegate problem
    By WinchellChung in forum Newbie
    Replies: 2
    Last Post: 5th December 2007, 16:16
  2. c++, placement delete upon exception
    By stinos in forum General Programming
    Replies: 6
    Last Post: 31st October 2006, 15:38
  3. Replies: 16
    Last Post: 7th March 2006, 15:57

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.