Extending Qt Creator Manual | SettingsDatabase

Extending Qt Creator Manual 4.3.1

# SettingsDatabase Class

(Core::SettingsDatabase)

The SettingsDatabase class offers an alternative to the application-wide QSettings that is more suitable for storing large amounts of data. More...

Header: | #include <SettingsDatabase>

- List of all members, including inherited members

## Public Functions

| SettingsDatabase(const QString &path, const QString &application, QObject *parent = 0)
| ~SettingsDatabase()
void | beginGroup(const QString &prefix)
void | beginTransaction()
QStringList | childKeys() const
bool | contains(const QString &key) const
void | endGroup()
void | endTransaction()
QString | group() const
void | remove(const QString &key)
void | setValue(const QString &key, const QVariant &value)
void | sync()
QVariant | value(const QString &key, const QVariant &defaultValue = QVariant()) const

## Detailed Description

The SettingsDatabase class offers an alternative to the application-wide QSettings that is more suitable for storing large amounts of data.

The settings database is SQLite based, and lazily retrieves data when it is asked for. It also does incremental updates of the database rather than rewriting the whole file each time one of the settings change.

The SettingsDatabase API mimics that of QSettings.

## Member Function Documentation

### SettingsDatabase::SettingsDatabase(const QString &path, const QString &application, QObject *parent = 0)

Default constructs an instance of SettingsDatabase.

### SettingsDatabase::~SettingsDatabase()

Destroys the instance of SettingsDatabase.

### void SettingsDatabase::beginGroup(const QString &prefix)

### void SettingsDatabase::beginTransaction()

### QStringList SettingsDatabase::childKeys() const

### bool SettingsDatabase::contains(const QString &key) const

### void SettingsDatabase::endGroup()

### void SettingsDatabase::endTransaction()

### QString SettingsDatabase::group() const

### void SettingsDatabase::remove(const QString &key)

### void SettingsDatabase::setValue(const QString &key, const QVariant &value)

See also value().

### void SettingsDatabase::sync()

### QVariant SettingsDatabase::value(const QString &key, const QVariant &defaultValue = QVariant()) const

See also setValue().