QSettings settings("company", "application"); settings.setValue("username", "John"); settings.setValue("password", "secret");
QSettings settings("company", "application"); QString username = settings.value("username").toString();This code creates a QSettings object with the specified company and application names ("company" and "application" in this case). It then reads the value of the "username" key and stores it in a QString variable. QSettings is part of the Qt Core library.