Results 1 to 11 of 11

Thread: using Qlist with a class

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    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
    Because I am using SSE2 instructions, the program crashes...
    It doesn't crash on my system. Are there any error messages? What CPU do you have?

    Quote Originally Posted by Havard View Post
    My question? How would I rewrite the program to allow for QList<myClass> list; instead of QList<myClass *> list;
    Just change:
    Qt Code:
    1. QList<myClass *> list;
    2. list.append(new myClass());
    To copy to clipboard, switch view to plain text mode 
    to
    Qt Code:
    1. QList<myClass> list;
    2. list.append( myClass() );
    To copy to clipboard, switch view to plain text mode 
    The default implementations of operator= and copy constructor will be enough for myClass.

  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, 16:41
  2. Accessing QList Objects
    By magikalpnoi in forum Qt Programming
    Replies: 7
    Last Post: 21st September 2006, 21:43
  3. Replies: 2
    Last Post: 4th May 2006, 20:17
  4. How to propagate from one class to another
    By mahe2310 in forum Qt Programming
    Replies: 15
    Last Post: 20th March 2006, 02:27
  5. Replies: 5
    Last Post: 15th March 2006, 08: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.