Results 1 to 11 of 11

Thread: using Qlist with a class

Threaded View

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

    Default Re: using Qlist with a class

    Quote Originally Posted by Havard View Post
    How do I then use the .append() since it needs an argument, and my class does not take arguments?
    Qt Code:
    1. QList< Something * > list;
    2.  
    3. Something * something = new Something();
    4. list.append( something );
    5. // or simply:
    6. list.append( new Something() );
    To copy to clipboard, switch view to plain text mode 
    Don't forget to delete the items when you remove them from the list (qDeleteAll( list ) might be helpful).

  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.