Results 1 to 6 of 6

Thread: std vs qt containers

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: std vs qt containers

    Don't use ranged for with a Qt container, at least not with non-const one.
    On a non-const container, ranged for will call non-const begin/end, which will cause a Qt container to deep copy if its reference counter is > 1.

    http://www.dvratil.cz/2015/06/qt-con...e-based-loops/

    In general, use vector over list, e.g. QVector or std::vector instead of QList, unless you need the list features.

    https://marcmutz.wordpress.com/effective-qt/containers/

    Cheers,
    _

  2. #2
    Join Date
    Jun 2015
    Location
    California, USA
    Posts
    61
    Thanks
    43
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11

    Default Re: std vs qt containers

    Wow... there is a lot of information in those blogs.

    Thanks all.

Similar Threads

  1. Drawing rectangle containers ;
    By mut in forum Qt Programming
    Replies: 1
    Last Post: 25th June 2014, 07:09
  2. Qt containers
    By Ashish Bhasin in forum Newbie
    Replies: 5
    Last Post: 14th April 2014, 12:50
  3. Best way to represent struct using Qt containers
    By rajil.s in forum Qt Programming
    Replies: 2
    Last Post: 25th January 2012, 18:30
  4. About STL containers and QT equivalent
    By tonnot in forum Qt Programming
    Replies: 7
    Last Post: 11th February 2011, 14:17
  5. Qt containers or STL containers?
    By sparticus_37 in forum Newbie
    Replies: 2
    Last Post: 11th May 2010, 15:12

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.