Results 1 to 11 of 11

Thread: using Qlist with a class

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: using Qlist with a class

    Quote Originally Posted by Havard View Post
    does this mean I have to equip my class with a default constructor, a copy constructor, and an assignment operator, even though it does not have (or need) any of this at the present?
    You can avoid this by creating a list of pointers.

    Quote Originally Posted by Havard View Post
    it says: "If we don't provide a copy constructor or an assignment operator, C++ provides a default implementation that performs a member-by-member copy. "

    How come?
    That's how C++ works. You can disable this by delaring those methods as private.

  2. The following user says thank you to jacek for this useful post:

    Havard (17th February 2007)

Similar Threads

  1. QList usage in place QPtrList
    By darpan in forum Qt Programming
    Replies: 2
    Last Post: 25th October 2006, 15:41
  2. Accessing QList Objects
    By magikalpnoi in forum Qt Programming
    Replies: 7
    Last Post: 21st September 2006, 20:43
  3. Replies: 2
    Last Post: 4th May 2006, 19:17
  4. How to propagate from one class to another
    By mahe2310 in forum Qt Programming
    Replies: 15
    Last Post: 20th March 2006, 01:27
  5. Replies: 5
    Last Post: 15th March 2006, 07:33

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.