Results 1 to 13 of 13

Thread: QList of my own class (append)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QList of my own class (append)

    This code iterate over the QList and call the toString() member function:
    Qt Code:
    1. for(QList<Transaction>::ConstIterator it = m_Transactions.begin(); it != m_Transactions.end(); ++it) {
    2. std::cout << qPrintable(it->toString()); //i used qPrintable to be able to print QString to std::cout
    3. }
    To copy to clipboard, switch view to plain text mode 

    LE: and about the problem if you sell many times, make sure you call sell for the same object, or you can post more code, because that append should work.

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

    april26 (19th March 2011)

Similar Threads

  1. Does QList use copy constructor when some element append to it?
    By indomie_seleraku in forum Qt Programming
    Replies: 7
    Last Post: 17th December 2010, 19:47
  2. QList append() problem
    By reuabreliz in forum Qt Programming
    Replies: 6
    Last Post: 6th January 2010, 13:27
  3. error with QList with a class
    By john_god in forum Newbie
    Replies: 7
    Last Post: 12th January 2009, 21:48
  4. Cannot append to QFile using QIODevice::Append
    By philwinder in forum Qt Programming
    Replies: 4
    Last Post: 17th November 2008, 09:09
  5. using Qlist with a class
    By Havard in forum Qt Programming
    Replies: 10
    Last Post: 24th February 2007, 19:38

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.