How to Use QSettings

From Qt Wiki
Revision as of 15:51, 14 January 2015 by Maintenance script (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

English Български

How to Use QSettings

QSettings [qt.io] class provides platform-independent application settings. The following example shows how to save and load settings to an ini file. The instance of QSettings will take care of writing and reading the settings from the ini file. The example has been tested on Nokia device with Symbian^3 OS.

Save Settings

Method setValue [qt.io] should be used to save a value of a key (aka the name of the setting).

Load Settings

The value of a setting can be obtained using method value [qt.io].

Example

mainwindow.h

mainwindow.cpp

main.cpp

Categories: