Qt-UI

Settings

Menus | | Layout Example

The persistent settings of an application are accessed with a QSettings object with a unique organization and application name:

QSettings settings("www.th-nuernberg.de", "MyApp");

Making a user-defined application property persistent, means setting a particular value for a unique property identifier on program exit:

QString value="setting";
settings.setValue("id", value);

There are overloaded setters for most basic Qt data types like int, double and QString.

The persistent values are retrieved at program start with:

if (settings.contains("id"))
   value = settings.value("id").toString();
else
   value = "default";


Menus | | Layout Example

Options: