QString str = "123"; unsigned int num = str.toUInt(); // num equals 123
QString str = "123ABC"; unsigned int num = str.toUInt(); // num equals 123
QString str = "Not a number"; unsigned int num = str.toUInt(); // num equals 0This example shows that if the QString cannot be converted to an unsigned integer, toUInt will return 0. The toUInt function is part of the QString class in the Qt library for C++.