Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QVariant QSettings::value ( const QString key,
const QVariant defaultValue = QVariant() 
) const

Returns the value for setting key. If the setting doesn't exist, returns defaultValue.

If no default value is specified, a default QVariant is returned.

Note that the Windows registry and INI files use case-insensitive keys, whereas the Carbon Preferences API on Mac OS X uses case-sensitive keys. To avoid portability problems, see the {Key Syntax} rules.

Example:

doc/src/snippets/code/src_corelib_io_qsettings.cpp 26

See also:
setValue(), contains(), remove()

Definition at line 3266 of file qsettings.cpp.

Referenced by beginReadArray(), QLibraryInfo::location(), QColorDialog::QColorDialog(), and MainWindow::readSettings().

{
    Q_D(const QSettings);
    QVariant result = defaultValue;
    QString k = d->actualKey(key);
    d->get(k, &result);
    return result;
}


Generated by  Doxygen 1.6.0   Back to index