Results 1 to 3 of 3

Thread: Problems subclassing QListWidgetItem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problems subclassing QListWidgetItem

    The problem went away when I removed Q_OBJECT from the code.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problems subclassing QListWidgetItem

    Q_OBJECT provides some additional functionality for objects -- like signals, slots, etc. But it also requires that the class inherits QObject, which was missing in your case. But if you don't need signals/slots or meta-data, you don't need the Q_OBJECT macro.

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

    Phlucious (18th June 2013)

Similar Threads

  1. Check Box problem
    By Seema Rao in forum Qt Programming
    Replies: 6
    Last Post: 30th November 2007, 19:32
  2. Problems with Q_OBJECT and subclassing
    By renaissanz in forum Qt Programming
    Replies: 4
    Last Post: 21st February 2006, 22:18

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.