Qt’s containers and strings are implicitly shared: copying one copies a pointer
and bumps a reference count, and the deep copy happens only when somebody
writes.
QString a = QStringLiteral("shipped");
QString b = a; // no copy: both point at the same data
b.append('!'); // now b detaches and copies
The cost model is worth stating precisely. For copies of which are
written to, the deep copies performed are
which is why passing QString by value is not the mistake the same
code would be with std::string.