Results 1 to 8 of 8

Thread: About STL containers and QT equivalent

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default About STL containers and QT equivalent

    In both cases, I would like to view a perfomance comparison between containers, with some examples: list > bla bla bla, vector > bla bla bla, etc.
    First I'd like to view a general comparison, later a comparison with QT equivalents.
    Can anyone give me some link?
    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: About STL containers and QT equivalent

    Performance comparisons in what situations? Insert, lookup, deletion and in the beginning, middle or end of the container? You have to be more specific. If you expected a single sentence stating that std::list is faster than std::vector then you won't get such a "benchmark". Besides you can always write your own.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: About STL containers and QT equivalent

    I simply am looking for an article that talk about the theme.
    What container is recomended for.... what can I expect from every type, etc.
    And finally a question about QT containers, are better than STL?
    Thanks Wy
    Last edited by tonnot; 11th February 2011 at 11:19.

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: About STL containers and QT equivalent

    And finally a question about QT containers, are better that STL?
    Is a hammer better than a screwdriver?

    In the STL documentation for each class, they explain for each container, what kind of algorithm it uses, and for which kind of task it is optimized.
    so a vector is better than a list for some things, and vice versa for others.
    The Qt container classes documentation explains in what way the Qt containers are different, and when they should be preferred.
    http://doc.trolltech.com/4.7/containers.html
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: About STL containers and QT equivalent

    I stick to Qt containers when i am coding in Qt. Many functions in Qt return/expect a QList and it is a waste of time converting between STL and Qt. Finally the implicit sharing means i dont have to allocate everything on heap ( for example returning a locally created list).

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: About STL containers and QT equivalent

    There is also this:
    http://doc.trolltech.com/qq/qq19-containers.html
    and this:
    http://labs.qt.nokia.com/2006/10/16/...it-worth-it-2/
    http://labs.qt.nokia.com/2006/10/16/...the-benchmark/

    But none of these will answer a question what is "better" than something else.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: About STL containers and QT equivalent

    Thanks.
    I only want to learn.
    Sun people have a good article about it (in Java app), but I dont think I can extrapolate the information to c++, isn't it.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: About STL containers and QT equivalent

    No,, you can't.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 1
    Last Post: 25th June 2010, 13:17
  2. Adding signals to qt containers
    By piotr.dobrogost in forum Qt Programming
    Replies: 2
    Last Post: 3rd June 2010, 20:58
  3. Qt containers or STL containers?
    By sparticus_37 in forum Newbie
    Replies: 2
    Last Post: 11th May 2010, 15:12
  4. QVector, containers, deep copy
    By TheKedge in forum Qt Programming
    Replies: 2
    Last Post: 23rd January 2007, 05:45
  5. scrolled widgets containers in Mainwindow
    By antonio.r.tome in forum Qt Programming
    Replies: 1
    Last Post: 24th October 2006, 14:40

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.