QString str = "HELLO WORLD"; QString lowerStr = str.lower(); // lowerStr = "hello world"
QString str; std::cin >> str; QString lowerStr = str.lower(); std::cout << "Lowercase string: " << lowerStr.toStdString() << std::endl;In this example, the user inputs a QString object `str` from the console and the `lower()` method is used to convert it to lowercase. The `toStdString()` method is used to convert the QString object back to a standard string format and outputted to the console. The `lower()` method is a member function of the QString class in the Qt library.