Is it possible that a temporary QString will be destroyed before calling the [] operator?
No, the warning is not about unsafe operation. The behavior here is completely defined as temporary ones are not destroyed until the end of the full expression in which they are created (i.e. until the end of the instruction returnin your case).
: , . , .at(0) .operator[](0). .
, Qt ; , , (, copy-on-write).
, ( ) , , .
, ( operator[]), , ( ) .
, , QString str = "abc";, QChar ch = str[0];, QString operator[], , , , , str[0] = 'x';. , , . const, / .
Clazy , ( , ).
: