Why must Qt have a 'Q' version for many standard objects/data structures in C++? Does the reasoning spawn from one source (i.e. there needs to be attached meta data for formatting purpose), or is it something that just depends on the case (e.g. QString allows for more language settings and QVectors allow for 'whatever')?
Thanks!
Qt containers precede STL containers, original versions (in Qt 1 or Qt 2 or something) were created when there were no standard C++ alternatives. Also, adaptation of the STL for all (at that time) supported compilers was gradual, and Qt was geared toward being cross-platform, so keeping its own implementation guaranteed it would work the same everywhere. And getting rid of the Qt's own types now, for next major Qt version, would mean impossible amount of porting work, so such a new version would effectively be dead on arrival.
Qt containers are actually different, they use implicit data sharing with Copy-on-write semantics and reference counting. Advantages and disadvantages of this approach are beyond the scope of this, but Qt implementation is good at least for the Qt Framework use, due to how signals and slots work (especially queued connections).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With