Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 435905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:25:24+00:00 2026-05-12T20:25:24+00:00

What are the pros and cons of using Qt containers ( QMap , QVector

  • 0

What are the pros and cons of using Qt containers (QMap, QVector, etc.) over their STL equivalent?

I can see one reason to prefer Qt:

  • Qt containers can be passed along to other parts of Qt. For example, they can be used to populate a QVariant and then a QSettings (with some limitation though, only QList and QMap/QHash whose keys are strings are accepted).

Is there any other?

Edit: Assuming the application already relies on Qt.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T20:25:25+00:00Added an answer on May 12, 2026 at 8:25 pm

    I started by using std::(w)string and the STL containers exclusively and converting to/from the Qt equivalents, but I have already switched to QString and I find that I’m using Qt’s containers more and more.

    When it comes to strings, QString offers much more complete functionality compared to std::basic_string and it is
    completely Unicode aware. It also offers an efficient COW implementation, which I’ve come to rely on heavily.

    Qt’s containers:

    • offer the same COW implementation as in QString, which is extremely useful when it comes to using Qt’s foreach macro
      (which does a copy) and when using meta-types or signals and slots.
    • can use STL-style iterators or Java-style iterators
    • are streamable with QDataStream
    • are used extensively in Qt’s API
    • have a stable implementation across operating systems. A STL implementation must obey the C++ standard, but
      is otherwise free to do as it pleases (see the std::string COW controversy). Some STL implementations are especially
      bad.
    • provide hashes, which are not available unless you use TR1

    The QTL has a different philosophy from the STL, which is well summarized by J. Blanchette: “Whereas STL’s containers are optimized for raw speed, Qt’s container classes have been carefully designed to provide convenience, minimal memory usage, and minimal code expansion.”
    The above link provides more details about the implementation of the QTL and what optimizations are used.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What's pros and cons of using Enterprise Library Unity vs other IoC containers (Windsor,
What are the pros/cons of using black-box reuse over white-box reuse?
What are the pros and cons of using table aliases in SQL? I personally
What are the pros and cons of using a hosting provider for a Subversion
What are the pros and cons of using Criteria or HQL ? The Criteria
What are the pros and cons of using nested public C++ classes and enumerations?
What are the pros and cons of using System.Security.Cryptography.RNGCryptoServiceProvider vs System.Random . I know
I wish to know all the pros and cons about using these two methods.
I would like to have a reference for the pros and cons of using
I would like to know what the pros and cons are for using an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.