Skip to content
tpyssysa edited this page Feb 28, 2018 · 22 revisions

Item Containers

Explanation of the contents of a topic page @ Week 1 Topic 1

Back to Week 1

Objectives: Adding, iterating, manipulating data in some containers

Comment: Instead of "in some containers" I would use "in item containers"

Comment: Attendees should realise it's totally ok to use standard containers. There are conversion functions between the standard and Qt item containers. The added-value of Qt containers is implicit sharing. It's efficient to take copies of huge containers, as long as the items are not changed, which will result to deep copy. Important learning objective is to do the iteration in the right way: non-mutable with simple range loop for (const &noteConstRefToMyItem : container) and QMutableXXIterator for mutable iterating. These are typically the fastest ones.

Beginner

Intermediate

  • What are Containers?
  • What are the Container classes?

Comment: * What are assignable types?

Comment: * How to iterate containers efficiently? (for-range loop + Java-like iterators)

Comment: * Qt algorithms are mostly depicted, so perhaps * How to use algorithms in container manipulation?

Expert

!NB: The doc.qt.io Container page is pretty exhaustive. We may not need much more than a shorter introductory presentation here.

Clone this wiki locally