45 #include <QtCore/qobject.h> 46 #include <QtCore/qvariant.h> 47 #include <QtCore/qstring.h> 55 #ifndef QT_NO_SETTINGS 58 #include <QtCore/qstringlist.h> 65 #ifdef Status // we seem to pick up a macro Status --> int somewhere 125 #ifndef QT_NO_QOBJECT 178 #ifndef QT_NO_TEXTCODEC 198 inline QT3_SUPPORT
bool writeEntry(
const QString &key,
bool value)
200 inline QT3_SUPPORT
bool writeEntry(
const QString &key,
double value)
202 inline QT3_SUPPORT
bool writeEntry(
const QString &key,
int value)
204 inline QT3_SUPPORT
bool writeEntry(
const QString &key,
const char *value)
206 inline QT3_SUPPORT
bool writeEntry(
const QString &key,
const QString &value)
225 return str.
split(separator);
234 inline QT3_SUPPORT
int readNumEntry(
const QString &key,
int defaultValue = 0,
bool *ok = 0)
240 inline QT3_SUPPORT
double readDoubleEntry(
const QString &key,
double defaultValue = 0,
247 inline QT3_SUPPORT
bool readBoolEntry(
const QString &key,
bool defaultValue =
false,
254 inline QT3_SUPPORT
bool removeEntry(
const QString &key)
255 {
remove(
key);
return true; }
257 enum System { Unix, Windows, Mac };
258 inline QT3_SUPPORT
void insertSearchPath(
System,
const QString &) {}
259 inline QT3_SUPPORT
void removeSearchPath(
System,
const QString &) {}
262 Scope scope = Global)
265 organization, application);
267 inline QT3_SUPPORT
void resetGroup()
295 #ifndef QT_NO_QOBJECT 309 #endif // QT_NO_SETTINGS 313 #endif // QSETTINGS_H The QVariant class acts like a union for the most common Qt data types.
static void allKeys(HKEY parentHandle, const QString &rSubKey, NameSet *result)
Status
The following status values are possible:
void setValue(const QString &key, const QVariant &value)
Sets the value of setting key to value.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
Returns the value for setting key.
Scope scope() const
Returns the scope used for storing the settings.
static Format defaultFormat()
#define QT_END_NAMESPACE
This macro expands to.
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
bool isWritable() const
Returns true if settings can be written using this QSettings object; returns false otherwise...
int beginReadArray(const QString &prefix)
Adds prefix to the current group and starts reading from an array.
The QSettings class provides persistent platform-independent application settings.
void endGroup()
Resets the group to what it was before the corresponding beginGroup() call.
Format
This enum type specifies the storage format used by QSettings.
void beginGroup(const QString &prefix)
Appends prefix to the current group.
static void clear(QVariant::Private *d)
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
static LibLoadStatus status
void setIniCodec(QTextCodec *codec)
Sets the codec for accessing INI files (including .
bool toBool() const
Returns the variant as a bool if the variant has type() Bool.
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
static void setPath(Format format, Scope scope, const QString &path)
Sets the path used for storing settings for the given format and scope, to path.
void sync()
Writes any unsaved changes to permanent storage, and reloads any settings that have been changed in t...
void endArray()
Closes the array that was started using beginReadArray() or beginWriteArray().
The QChar class provides a 16-bit Unicode character.
QTextCodec * iniCodec() const
Returns the codec that is used for accessing INI files.
QString group() const
Returns the current group.
QStringList childGroups() const
Returns a list of all key top-level groups that contain keys that can be read using the QSettings obj...
The QScopedPointer class stores a pointer to a dynamically allocated object, and deletes it upon dest...
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
QStringList toStringList() const
Returns the variant as a QStringList if the variant has type() StringList, String ...
QFuture< void > map(Sequence &sequence, MapFunction function)
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool isEmpty(const char *str)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static void setUserIniPath(const QString &dir)
Use setPath() instead.
The QStringList class provides a list of strings.
static QTextCodec * codec(MYSQL *mysql)
QString organizationName() const
Returns the organization name used for storing the settings.
QStringList childKeys() const
Returns a list of all top-level keys that can be read using the QSettings object. ...
void setArrayIndex(int i)
Sets the current array index to i.
QString join(const QString &sep) const
Joins all the string list's strings into a single string with each element separated by the given sep...
~QSettings()
Destroys the QSettings object.
bool contains(const QString &key) const
Returns true if there exists a setting called key; returns false otherwise.
QSettings(const QString &organization, const QString &application=QString(), QObject *parent=0)
Constructs a QSettings object for accessing settings of the application called application from the o...
double toDouble(bool *ok=0) const
Returns the variant as a double if the variant has type() Double , QMetaType::Float ...
static Format registerFormat(const QString &extension, ReadFunc readFunc, WriteFunc writeFunc, Qt::CaseSensitivity caseSensitivity=Qt::CaseSensitive)
Registers a custom storage format.
QScopedPointer< QObjectData > d_ptr
QMap< QString, QVariant > SettingsMap
Typedef for QMap<QString, QVariant>.
#define Q_DECLARE_PRIVATE(Class)
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
static void setSystemIniPath(const QString &dir)
Use setPath() instead.
The QTextCodec class provides conversions between text encodings.
QString applicationName() const
Returns the application name used for storing the settings.
void beginWriteArray(const QString &prefix, int size=-1)
Adds prefix to the current group and starts writing an array of size size.
The QIODevice class is the base interface class of all I/O devices in Qt.
The QEvent class is the base class of all event classes.
static QString fileName(const QString &fileUrl)
static void setDefaultFormat(Format format)
void setFallbacksEnabled(bool b)
Sets whether fallbacks are enabled to b.
bool fallbacksEnabled() const
Returns true if fallbacks are enabled; returns false otherwise.