SettingsAccessor Class | Extending Qt Creator Manual

Extending Qt Creator Manual | SettingsAccessor

Extending Qt Creator Manual 4.5.0

# SettingsAccessor Class

(ProjectExplorer::SettingsAccessor)

- List of all members, including inherited members

## Public Types

class | IssueInfo
typedef | ButtonMap
enum | ProceedInfo { Continue, DiscardAndContinue }

## Public Functions

| SettingsAccessor(Project *project)
virtual | ~SettingsAccessor()
bool | addVersionUpgrader(Internal::VersionUpgrader *upgrader)
int | currentVersion() const
int | firstSupportedVersion() const
Project * | project() const
QVariantMap | restoreSettings(QWidget *parent) const
bool | saveSettings(const QVariantMap &data, QWidget *parent) const

## Static Public Members

int | originalVersionFromMap(const QVariantMap &data)
QVariantMap | setOriginalVersionInMap(const QVariantMap &data, int version)
QVariantMap | setVersionInMap(const QVariantMap &data, int version)
int | versionFromMap(const QVariantMap &data)

## Protected Functions

virtual Utils::FileName | backupName(const QVariantMap &data) const
virtual IssueInfo | findIssues(const QVariantMap &data, const Utils::FileName &path) const
virtual bool | isBetterMatch(const QVariantMap &origData, const QVariantMap &newData) const
virtual QVariantMap | prepareSettings(const QVariantMap &data) const
virtual QVariantMap | prepareToSaveSettings(const QVariantMap &data) const
QVariantMap | readFile(const Utils::FileName &path) const
ProceedInfo | reportIssues(const QVariantMap &data, const Utils::FileName &path, QWidget *parent) const
QVariantMap | upgradeSettings(const QVariantMap &data) const

## Member Type Documentation

### typedef SettingsAccessor::ButtonMap

### enum SettingsAccessor::ProceedInfo

## Member Function Documentation

### SettingsAccessor::SettingsAccessor(Project *project)

Default constructs an instance of SettingsAccessor.

### `[virtual]` SettingsAccessor::~SettingsAccessor()

Destroys the instance of SettingsAccessor. The destructor is virtual.

### bool SettingsAccessor::addVersionUpgrader(Internal::VersionUpgrader *upgrader)

### `[virtual protected]` Utils::FileName SettingsAccessor::backupName(const QVariantMap &data) const

### int SettingsAccessor::currentVersion() const

### `[virtual protected]` IssueInfo SettingsAccessor::findIssues(const QVariantMap &data, const Utils::FileName &path) const

### int SettingsAccessor::firstSupportedVersion() const

### `[virtual protected]` bool SettingsAccessor::isBetterMatch(const QVariantMap &origData, const QVariantMap &newData) const

Check which of two sets of data are a better match to load.

This method is used to compare data extracted from two XML settings files. It will never be called with a version too old or too new to be read by the current instance of Qt Creator.

Compares newData against origData.

Returns `true` if newData is a better match than origData and `false` otherwise.

### `[static]` int SettingsAccessor::originalVersionFromMap(const QVariantMap &data)

### `[virtual protected]` QVariantMap SettingsAccessor::prepareSettings(const QVariantMap &data) const

Run directly after reading the data.

This method is called right after reading the data before any attempt at interpreting the data is made.

Returns the prepared data.

### `[virtual protected]` QVariantMap SettingsAccessor::prepareToSaveSettings(const QVariantMap &data) const

### Project *SettingsAccessor::project() const

### `[protected]` QVariantMap SettingsAccessor::readFile(const Utils::FileName &path) const

### `[protected]` ProceedInfo SettingsAccessor::reportIssues(const QVariantMap &data, const Utils::FileName &path, QWidget *parent) const

### QVariantMap SettingsAccessor::restoreSettings(QWidget *parent) const

### bool SettingsAccessor::saveSettings(const QVariantMap &data, QWidget *parent) const

### `[static]` QVariantMap SettingsAccessor::setOriginalVersionInMap(const QVariantMap &data, int version)

### `[static]` QVariantMap SettingsAccessor::setVersionInMap(const QVariantMap &data, int version)

### `[protected]` QVariantMap SettingsAccessor::upgradeSettings(const QVariantMap &data) const

Upgrade the settings in data to the version toVersion.

Returns settings of the requested version.

### `[static]` int SettingsAccessor::versionFromMap(const QVariantMap &data)