QString str = "Hello, world!";
QString str = "Hello, world!"; std::wstring wstr = str.toStdWString();
QString str1 = "Hello"; QString str2 = "world!"; QString result = str1 + " " + str2;In this example, we concatenate the QString objects "str1" and "str2" to create a new QString object "result" that contains the text "Hello world!". The QString class is a part of the QtCore module in the Qt framework.