QString myQString = "Hello World!"; std::string myStdString = myQString.toStdString();
QString myQString = "123"; int myInt = myQString.toInt();In this example, we create a QString with the value "123" and then convert it to an integer using the toInt function from the QString class. The package library is the Qt Library.