Results 1 to 5 of 5

Thread: segfaulting delegate, please help

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2010
    Location
    Wokingham, United Kingdom
    Posts
    36
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    7
    Thanked 2 Times in 2 Posts

    Default Re: segfaulting delegate, please help

    thanks i did that, and now it doesn't compile. I get

    Qt Code:
    1. /home/james/myTunes/mytunes.cpp:10: error: cannot allocate an object of abstract type ‘mediaItemDelegate’
    2. /home/james/myTunes/mediaitemdelegate.h:25: note: because the following virtual functions are pure within ‘mediaItemDelegate’:
    3. /home/james/myTunes/mediaitemdelegate.h:30: note: virtual void mediaItemDelegate::paint(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const
    4. /home/james/myTunes/mediaitemdelegate.h:31: note: virtual QSize mediaItemDelegate::sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const
    To copy to clipboard, switch view to plain text mode 

    i've declared the delegate class in the header, and included the delegate's source, and i've created the object.
    is it something immensely simple that i'm missing here??

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: segfaulting delegate, please help

    Quote Originally Posted by janorcutt View Post
    is it something immensely simple that i'm missing here??
    If you ask so: Yes You don't have to declare virtual functions you have to reimp them! So just delete the two " = 0;" from your header file and all should work fine.

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

    janorcutt (24th February 2010)

  4. #3
    Join Date
    Feb 2010
    Location
    Wokingham, United Kingdom
    Posts
    36
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    7
    Thanked 2 Times in 2 Posts

    Smile Re: segfaulting delegate, please help

    thanks i just figured that out for myself, that'll teach me to cut and paste

    thanks for the help anyway

    janorcutt

Similar Threads

  1. QTableWidget Delegate
    By aekilic in forum Qt Programming
    Replies: 12
    Last Post: 15th May 2009, 09:21
  2. Delegate for a certain item?
    By somebody in forum Qt Programming
    Replies: 1
    Last Post: 18th August 2008, 22:55
  3. Qt 4.2 apps segfaulting
    By IndigoJo in forum Qt Programming
    Replies: 1
    Last Post: 24th June 2008, 23:29
  4. Delegate but when
    By uygar in forum Qt Programming
    Replies: 1
    Last Post: 12th October 2007, 20:28
  5. Why is my program segfaulting?
    By Valheru in forum Qt Programming
    Replies: 11
    Last Post: 1st October 2006, 10:59

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.