QString str = "Hello world"; int len = str.size(); // len is now 11
QString str = "Hello world"; for (int i = 0; i < str.size(); i++) { // do something with str.at(i) }The QString size method is part of the Qt Core library, which is included in the Qt package.